lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Wang" <john.w...@gmail.com>
Subject Re: Sorting documents without a query
Date Fri, 05 Dec 2008 09:35:24 GMT
The obvious way is to use use MatchAllDocsQuery with Sort parameters on the
searcher, e.g.

searcher.search(new MatchAllDocsQuery(),sort);

If you only care about 1 sort spec (e.g. no secondary sort to break ties) it
may be faster just traversing the term table since that is already sorted.

-John

On Thu, Dec 4, 2008 at 11:12 PM, Shivaraj Tenginakai <tshivaraj@gmail.com>wrote:

> I have a usecase in which I have no search query, but still need to sort
> documents. For example, items need to be sorted by price, though the user
> has not yet selected any search criteria.
>
> What would be the best way to achieve this?
>
> Thanks and Regards,
>
> Shivaraj
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message