lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: sorting problem
Date Tue, 08 May 2007 17:40:53 GMT

: My query tries to search all entries which their ctype is video sorted by
: tstamp descending and then sorted by popularity:

: However the results returned are sorted only by the tstamp.

Solr stores datefields with millisecond precision, so if you index a date
field without rounding, then all of htat precision is going to be there
when it comes time to sort ... you can clearly see in your output that the
results are strictly sorted by your first critera .. the secondary sort
will only come into play if two docs have *exactly* the same value for the
tstamp field.

assuming you generate your tstamp field using the "NOW" default in your
schema.xml, you can get rounding by using the DateMath feature, something
like this...

   <field name="timestamp" type="date" default="NOW/MINUTE" />

...but if you are generating the tstamp field values in your client and
then sending them to Solr, you'll need to do the rounding there.


View raw message