lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oren Shir <sho...@gmail.com>
Subject Re: Reverse sorting by index order
Date Thu, 03 Nov 2005 15:22:06 GMT
Hi,

There is no constructor for Sort(SortField, boolean) in Lucene API. Which
version are you using?

Thanks,
Oren Shir

On 11/3/05, Andy Lee <aglee@earthlink.net> wrote:
>
> On Nov 3, 2005, at 9:37 AM, Oren Shir wrote:
> > If I understand correctly, when sorting by Sort.INDEXORDER the oldest
> > documents that were added to the index will be returned first. I
> > want the
> > reverse, because I'm more interested in newer documents.
>
> Looking at the source, I see that Sort.INDEXORDER is simply an
> instance of Sort:
>
> public static final Sort INDEXORDER = new Sort(SortField.FIELD_DOC);
>
> Haven't tried this myself, but you could create your own instance
> that uses a reverse sort:
>
> Sort reverseIndexOrder = new Sort(SortField.FIELD_DOC, true);
>
> And use that wherever you were using Sort.INDEXORDER.
>
> --Andy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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