lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <ysee...@gmail.com>
Subject Re: reverse sort
Date Tue, 29 Nov 2005 02:17:37 GMT
Grrrr, I think it's that AUTO sorting again...
Check out this bug:
http://issues.apache.org/jira/browse/LUCENE-463

If you specify a string sort explicitly, it should work.

If you are using a multisearcher, please upgrade to the latest lucene
version (there have been some sorting bug fixes).

-Yonik

On 11/28/05, Michael Pow <mpow@looksmart.net> wrote:
> I'm trying to reverse sort a result set by it's date field (YYYYMMDDhhmm).
>
> pseudocode:
> Boolean order = {false | true};
> Sort sorter = new Sort(new SortField("date", order));
> hits = indexSearcher.search(<query>, <filter>, sorter);
>
> When order = false, I correctly get the results sorted from the smallest
> date to the greatest, which also happens to be the order of insertion
> into the index.  When order = true (attempting to do reverse sort), it
> comes back almost correctly sorted from the largest date to the
> smallest, but it isn't exactly correct.   I'm surprised that switching
> the 'reverse' flag from false to true doesn't exactly invert the result
> set.  Has anyone encountered this before?  I can provide more details if
> necessary.
>
> Below is a result set ordered by date in reverse order
> format is {doc#, date}
>
> found : 44894   200511140845
> found : 31319   200511090101
> found : 33972   200511091353
> found : 35404   200511100600
> found : 36715   200511100729
> found : 26842   200511071324
> found : 27266   200511071734
> found : 27272   200511071738
> found : 27442   200511071826
> found : 15261   200511021245
> found : 16686   200511030630
> found : 17499   200511030706
> found : 17500   200511030706
> found : 3941   200510281753
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message