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: [email protected]


> -----Original Message-----
> From: Sirish Vadala [mailto:[email protected]]
> Sent: Thursday, April 29, 2010 8:09 PM
> To: [email protected]
> 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: [email protected]
> For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to