Solr
  1. Solr
  2. SOLR-170

StandardRequestHandler should support the 'sort' parameter

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      dismax and standard query handlers should both use the 'sort' parameter. We should discourage future use of the q=query;sort syntax for StandardRequestHandler

      1. SOLR-170-sort-parameter.patch
        12 kB
        Ryan McKinley
      2. SOLR-170-sort-parameter.patch
        8 kB
        Ryan McKinley
      3. SOLR-170-sort-parameter.patch
        9 kB
        Ryan McKinley
      4. SOLR-170-sort-parameter.patch
        9 kB
        Ryan McKinley

        Activity

        Hide
        Ryan McKinley added a comment -

        This simple patch adds 'sort' param to StandardRequestHandler and updates the tutorial docs to use the sort parameter rather then the ';' syntax

        Two things to note:

        1. I had to delete some "sort", "true" parameters from the BasicFunctionalityTest.java TestSimpleFacetCounts. "sort=true" does not evaluate to a valid sort string and these params were being ignored before

        2. This patch includes dummy defined constants in SolrParams. The trunk branch seems to be missing some HIGHLIGHT params. to get things to compile, i added the following - they should obviously not be commited:

        public static final String HIGHLIGHT_FIELDS = null;
        public static final String HIGHLIGHT = null;
        public static final String MAX_SNIPPETS = null;
        public static final String HIGHLIGHT_FORMATTER_CLASS = null;

        Show
        Ryan McKinley added a comment - This simple patch adds 'sort' param to StandardRequestHandler and updates the tutorial docs to use the sort parameter rather then the ';' syntax Two things to note: 1. I had to delete some "sort", "true" parameters from the BasicFunctionalityTest.java TestSimpleFacetCounts. "sort=true" does not evaluate to a valid sort string and these params were being ignored before 2. This patch includes dummy defined constants in SolrParams. The trunk branch seems to be missing some HIGHLIGHT params. to get things to compile, i added the following - they should obviously not be commited: public static final String HIGHLIGHT_FIELDS = null; public static final String HIGHLIGHT = null; public static final String MAX_SNIPPETS = null; public static final String HIGHLIGHT_FORMATTER_CLASS = null;
        Hide
        Ryan McKinley added a comment -

        Updated to compile with /trunk

        This would be a nice one to squeeze in a solr1.2 release. It is a minor interface change that will hopefully become the standard. I am revisiting SOLR-20 and it is easier to have a standard "sort" parameter rather then one that depends if you are using dismax or standard.

        Show
        Ryan McKinley added a comment - Updated to compile with /trunk This would be a nice one to squeeze in a solr1.2 release. It is a minor interface change that will hopefully become the standard. I am revisiting SOLR-20 and it is easier to have a standard "sort" parameter rather then one that depends if you are using dismax or standard.
        Hide
        Ryan McKinley added a comment -

        Cleaned the patch up a bit. I'd like to commit it, but someone should take a look first.

        This had to modify one line in BasicFunctionalityTest, there was a test that looks like it was trying to test the facet sorting. it added the parameter "sort"=true to a test – this was just getting ignored (it should be facet.sort=true) and does not parse as a valid sort field.

        Show
        Ryan McKinley added a comment - Cleaned the patch up a bit. I'd like to commit it, but someone should take a look first. This had to modify one line in BasicFunctionalityTest, there was a test that looks like it was trying to test the facet sorting. it added the parameter "sort"=true to a test – this was just getting ignored (it should be facet.sort=true) and does not parse as a valid sort field.
        Hide
        Ryan McKinley added a comment -

        Added a new StandardRequestHandlerTest class with a testSorting() function.

        Show
        Ryan McKinley added a comment - Added a new StandardRequestHandlerTest class with a testSorting() function.
        Hide
        Ryan McKinley added a comment -

        commited

        Show
        Ryan McKinley added a comment - commited
        Hide
        Hoss Man added a comment -

        This bug was modified as part of a bulk update using the criteria...

        • Marked ("Resolved" or "Closed") and "Fixed"
        • Had no "Fix Version" versions
        • Was listed in the CHANGES.txt for 1.2

        The Fix Version for all 39 issues found was set to 1.2, email notification
        was suppressed to prevent excessive email.

        For a list of all the issues modified, search jira comments for this
        (hopefully) unique string: 20080415hossman2

        Show
        Hoss Man added a comment - This bug was modified as part of a bulk update using the criteria... Marked ("Resolved" or "Closed") and "Fixed" Had no "Fix Version" versions Was listed in the CHANGES.txt for 1.2 The Fix Version for all 39 issues found was set to 1.2, email notification was suppressed to prevent excessive email. For a list of all the issues modified, search jira comments for this (hopefully) unique string: 20080415hossman2

          People

          • Assignee:
            Ryan McKinley
            Reporter:
            Ryan McKinley
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development