lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sirish Vadala <sirishre...@gmail.com>
Subject Using Sort
Date Thu, 29 Apr 2010 17:08:36 GMT

I have a requirement where in the results have to be sorted in ascending
order for few fields, and descending order for one field.

Currently I am using:

String[] sortOrder = { IFIELD_YEAR, IFIELD_TYPE, IFIELD_NUM, IFIELD_SESSION
};
Sort sort = new Sort(sortOrder);
hits = indexSearcher.search(booleanQuery, sort);

Using the above code, everything gets sorted in ascending order starting
with year, type, number and session in that precedence.

Now I have a requirement to first sort in ascending order for year, type and
number, and then sort in descending order only for session.

Is there a way to get this to work.

Thanks.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Using-Sort-tp765845p765845.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
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