Look at the other constructors of Sort taking SortFields. These ones are 
deprecated and were removed in 3.0. They are no longer supported. When 
constructing SortFields you can specify the type of sort and also the order.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: Sirish Vadala [mailto:sirishre...@gmail.com]
> Sent: Thursday, April 29, 2010 8:09 PM
> To: java-user@lucene.apache.org
> Subject: Using Sort
> 
> 
> 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-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

  • Using Sort Sirish Vadala
    • RE: Using Sort Uwe Schindler

Reply via email to