I changed to RangeFilter and now everything works fine. I havn't noticed any change in performance so I'm happy. Strange with the constantrangequery though...
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Yonik Seeley Sent: den 5 oktober 2006 17:06 To: java-user@lucene.apache.org Subject: Re: Sorting on dates using long On 10/5/06, Björn Ekengren <[EMAIL PROTECTED]> wrote: > I am trying to get sort by date to work. The dates are of form yyyyMMddhhmm > and it seems that sort sees them as Integers and discards the last four > numbers since an integer isn't large enough. I tried using SortField.STRING > instead but then constantrangequery breaks (date:[200501010101 TO > 200601010101] returns 0 hits). Using SortField.STRING should work, both with sorting and range queries via RangeFilter or ConstantScoreRangeQuery. -Yonik http://incubator.apache.org/solr Solr, the open-source Lucene search server --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]