lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <dan...@nuix.com>
Subject Re: How to make a case insensitive search using a FuzzyQuery?
Date Fri, 06 Jul 2007 04:15:12 GMT
On Friday 06 July 2007 11:39:00 Eloi Rocha Neto wrote:
> Hi,
>
>    Anyone knows how to make a case insensitive search using a FuzzyQuery?
>
>    I want that the results coming from "PP-Trip SubAlcance Seq Negativa",
> "pp-trip subAlcance seq negativa" and "PP-TRIP SUBALCANCE SEQ NEGATIVA" be
> the same. The field must be indexed by "PP-Trip SubAlcance Seq Negativa".
>
>    My code:
>       Query query = new FuzzyQuery( new Term( field, input ) , similarity
> ); Hits hits = indexSearcher.search(query);
>
>   I really appreciate any help!

Why don't you just have your analyser lowercase the field at indexing time?  I 
don't see why you would use a FuzzyQuery for something where a normal 
PhraseQuery should suffice.

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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