Uploaded image for project: 'Spring Data for Apache Solr'
  1. Spring Data for Apache Solr
  2. DATASOLR-400

Group sort parameters are not properly constructed beyond primary sort

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.11 (Hopper SR11)
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      DefaultQueryParser::processGroupOptions contains the following loop:

      if (groupOptions.getSort() != null) {
      	for (Order order : groupOptions.getSort()) {
      		solrQuery.add(GroupParams.GROUP_SORT, order.getProperty().trim() + " "
      				+ (order.isAscending() ? ORDER.asc : ORDER.desc));
      	}
      }
      

      For Sorts with more than one sort, this will produce `group.sort=a desc&group.sort=b asc` in the query parameters instead of the expected `group.sort=a desc, b asc`. With the current incorrect parameters that are generated, any secondary or later sorts are effectively lost from the query.

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            cfinucane Cameron Finucane
            Last updater:
            Cameron Finucane
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: