lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Österreicher <lukas.oesterreic...@austria.real.com>
Subject Re: Combining PrefixQuery and FuzzyQuery
Date Mon, 19 Apr 2010 15:00:12 GMT
Well, how would this look like in code?
Currently I have the prefix query like this:

BooleanQuery bQuery = new BooleanQuery();
PrefixQuery prefixQuery = new PrefixQuery(new Term("item.name", termText));
bQuery.add( prefixQuery, Occur.MUST);

I dont see any class named PrefixTerm.
I'd appreciate it if you could show me how it is done in java code.

Lukas

Am 19.04.10 16:48 schrieb "Uwe Schindler" unter <uwe@thetaphi.de>:

> How about a fuzzy query with a prefix term? Its configureable.
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
>> -----Original Message-----
>> From: Lukas Österreicher [mailto:lukas.oesterreicher@austria.real.com]
>> Sent: Monday, April 19, 2010 4:43 PM
>> To: java-user@lucene.apache.org
>> Subject: Combining PrefixQuery and FuzzyQuery
>> 
>> Hello.
>> 
>> Is it possible to combine PrefixQuery and FuzzyQuery?
>> The search on a term should both be fuzzy but also match with results
>> that
>> jut begin with that token (or an approximation of that token).
>> 
>> If it is possible, can you give me an example on how to achieve this?
>> 
>> Currently I only use the PrefixQuery and performance is ok.
>> Would performance with such a combination be much worse?
>> 
>> I would not even need a complete fuzzy search, it would suffice
>> To have the matching be done without caring for cases (this I already
>> have
>> present by using a modified WhitespaceTokenizer which filters
>> To lower cases) and with also matching characters where accents
>> Also match, so e would match é and è.
>> 
>> Finally, I would like to know how much sorting a string field
>> Which is not too long (containing track or album title) affects
>> performance
>> Copared to not providing any sorting parameters.
>> 
>> Thanx in advance,
>> Lukas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 


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