Hi,
Please note that you have two sort criteria, one to sort the documents
inside each group and one to sort the groups. In the example you sent, the
group 10002 has two documents and your group.limit is set to 1. If you redo
the query with group.limit=2 I suspect that you'll see the second document
of this group with a pricecommon_double between 479.99 and 729.97. This
would mean that the sorting is correct ;). Bottom line is that when you
have a group.sort different than the main sort, if the number of documents
in one group is more than one then you cannot ensure that this document
reflects the main sort. Try for instance "group.sort=pricecommon_double
asc" (main sort inverse order) and you'll see that the sort inside each
group is always applied after the main sort. This is the only way to meet
the expectations ;).

Cheers,
Jim



2015-03-17 9:48 GMT+01:00 kumarraj <rajitpro2...@gmail.com>:

> Thanks David, that was a typo.
> Do you see any other issues? While solr does the grouping and if more than
> one document which are matched with given group.sort condition(numfound=2),
> then that particular document is not sorted correctly, when sorted by
> price.(sort=price) is applied across all the groups.
>
> Example: Below is the sample result.
>
>  <arr name="groups">
>       <lst>
>         <str name="groupValue">10001</str>
>         <result name="doclist" numFound="1" start="0">
>           <doc>
>             <double name="pricecommon_double">729.97</double>
>             <str name="code_string">10001</str>
>             <str name="name_text">Product1</str>
>             <str name="storeName_string">203</str>
>             <double name="geodist()">198.70324062133778</double></doc>
>         </result>
>       </lst>
>       <lst>
>         <str name="groupValue">10002</str>
>         <result name="doclist" numFound="2" start="0">
>           <doc>
>             <double name="pricecommon_double">279.99</double>
>             <str name="code_string">10002</str>
>             <str name="name_text">Product2</str>
>             <str name="storeName_string">212</str>
>             <double name="geodist()">0.0</double></doc>
>         </result>
>       </lst>
>       <lst>
>         <str name="groupValue">10003</str>
>         <result name="doclist" numFound="1" start="0">
>           <doc>
>             <double name="pricecommon_double">479.99</double>
>             <str name="code_string">10003</str>
>             <str name="name_text">Product3</str>
>             <str name="storeName_string">203</str>
>             <double name="geodist()">198.70324062133778</double></doc>
>         </result>
>       </lst>
>
> I expect product 10002, to be sorted and shown after 1003, but it is not
> sorted correctly.
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-returns-incorrect-results-after-sorting-tp4193266p4193457.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to