lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "naveen.quill" <naveen.ve...@gmail.com>
Subject how to sort the result by ignoring case in lucene
Date Fri, 21 Nov 2008 05:57:12 GMT

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);
-- 
View this message in context: http://www.nabble.com/how-to-sort-the-result-by-ignoring-case-in-lucene-tp20615647p20615647.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