lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Can I sort search results by score and docID at one time?
Date Tue, 01 Feb 2005 11:03:16 GMT

On Feb 1, 2005, at 4:21 AM, Jingkang Zhang wrote:

> Lucene support sort by score or docID.Now I want to
> sort search results by score and docID or by two
> fields at one time, like sql
> command " order by score,docID" , how can I do it?

Sorting by multiple fields (including score and document id) is 
supported.  Here's an example:

	 new Sort(new SortField[]{
           new SortField("category"),
           SortField.FIELD_SCORE,
           new SortField("pubmonth", SortField.INT, true)
         })



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


Mime
View raw message