When you specify a sort parameter it totally overrides the
scoring. You can specify multiple sort criteria, e.g. both
live_dt and score. If you specify two sort criteria, any
ties in the first are broken by the second and so on through
as many sort criteria as you have specified.

Note that specifying secondary etc. sort criteria if the first
one is unlikely to result in a tie is pretty useless. I.e.t if
sorting by millisecond dates there will (probably) be very
few ties.

Best,
Erick


On Mon, Oct 14, 2013 at 1:30 AM, Darniz <rnizamud...@edmunds.com> wrote:

> Thanks eric
> i think thats the way to go
>
> This leads to one more question. since now that i have two doc with the
> same
> content path i want to get distinct content path with max date.
>
> <doc>
>     <field name="id">1</field>
>     <field name="contentPath">/editorial-updates</field>
>     <field name="live_dt>2013-09-01T00:00:00Z</field>
>     <field name="text">Sept content : Honda is releasing the car this
> month</field>
> </doc>
> <doc>
>     <field name="id">2</field>
>     <field name="contentPath">/editorial-updates</field>
>     <field name="live_dt>2013-10-01T00:00:00Z</field>
>     <field name="text">Oct content : Honda is releasing the car this
> month</field>
> </doc>
>
> For example if a user searches for car
> text:car AND live_dt:[* TO NOW]
>  then both the doc are returned. i want the max latest doc to come in the
> above case id=2 and the other document should not come,
>
> Just to add, i use dismax handler where we have boosting on specific fields
> and till now doc where returned by natural scoring order by dismax handler.
> if i add &sort=live_dt desc does it order doc purely by live_dt or also
> respect relevancy. since also have some other doc which dont have live_dt.
>
>
> any thoughts
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Doing-time-sensitive-search-in-solr-tp4092273p4095321.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to