lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael D. Curtin" <>
Subject Re: what is the best way to sort by document ids
Date Tue, 01 Nov 2005 13:15:07 GMT
Oren Shir wrote:

> My documents contain a field called SORT_ID, which contains an int that
> increases with every document added to the index. I want my results to be
> sorted by it.
> Which approach will prove the best performance:
> 1) Zero pad SORT_ID field and sort by it as plain text.
> 2) Sort using SortField for an INT.
> 3) Trust that using INDEXORDER will always return the same order as SORT_ID,
> and use that.

My experience is that #3 works very well in terms of performance, much 
better than sorting on any arbitrary field.  I haven't ever noticed a 
problem with it not working.  Good luck!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message