Java Mailing List Archive

http://www.java2.5341.com/

Home » java-user.lucene »

how to sort the result by ignoring case in lucene

naveen.quill

2008-11-21

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi,

I have a query regarding the sorting techniques in the lucene i.e
if i apply the sort method to the search results, lucene is sorting the
results by, without ignoring case, so, how to apply the sort technique that
it should sort by ignoring case

i.e :
if the results value are : {ACB, abc, adc, Aad},
After sorting the results by lucene : {Aad, ACB, abc, adc} [here the lucene
is taking uppercase words first to sort the results then lowercase],
but i need to get the results in this order : {Aad, abc, ACB, adc}

so how to sort the results by ignoring case

here is my code :
String queryComplex = "110_a_t:a* 110_a_t:A*";
SortField sortField = new SortField("110_a_t", SortField.STRING);
Sort sort = new Sort(sortField);
QueryParser queryParser=new QueryParser("",new StandardAnalyzer());
queryParser.setLowercaseExpandedTerms(false);
Query query = queryParser.parse(queryComplex);
org.apache.lucene.search.Hits
catalogueHits=search.indexSearcher.search(query, sort);
--
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@(protected)
For additional commands, e-mail: java-user-help@(protected)

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.