lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jim ferenczi <jim.feren...@gmail.com>
Subject Re: Solr returns incorrect results after sorting
Date Wed, 18 Mar 2015 16:52:07 GMT
Hi Raj,
The group.sort you are using defines multiple criterias. The first criteria
is the big solr function starting with the "max". This means that inside
each group the documents will be sorted by this criteria and if the values
are equals between two documents then the comparison fallbacks to the
second criteria (inStock_boolean desc) and so on.

*Even though if i add price asc in the group.sort, but still the main
sort does not consider that.*
The main sort does not have to consider what's in the group.sort. The
group.sort defines the way the documents are sorted inside each group. So
if you want to sort the document inside each group with the same order than
in the main sort you can remove the group.sort or you can have a primary
sort on pricecommon_double desc in your group.sort:
*group.sort=pricecommon_double
desc, max(if(exists(query({!v='storeName_string:212'})),2,0),if(exists(query({!v='storeName_string:203'})),1,0))
desc,inStock_boolean
desc,geodist() asc*


Cheers,
Jim



2015-03-18 7:28 GMT+01:00 kumarraj <rajitpro2008@gmail.com>:

> Hi Jim,
>
> Yes, you are right.. that document is having price 499.99,
> But i want to consider the first record in the group as part of the main
> sort.
> Even though if i add price asc in the group.sort, but still the main sort
> does not consider that.
>
> group.sort=max(if(exists(query({!v='storeName_string:212'})),2,0),if(exists(query({!v='storeName_string:203'})),1,0))
> desc,inStock_boolean desc&geodist() asc,pricecommon_double
> asc&sort=pricecommon_double desc
>
> Is there any other workaround so that sort is always based on the first
> record which is pulled up in each group?
>
>
> Regards,
> Raj
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-returns-incorrect-results-after-sorting-tp4193266p4193658.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message