lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: Questions about FuzzyQuery in Lucene 4.x
Date Tue, 29 Jan 2013 17:10:19 GMT
That depends on the value of "ed", and the indexed data.

Another factor to take into consideration is that a case change ("Star" vs. 
"star") also counts as an edit.

-- Jack Krupansky

-----Original Message----- 
From: George Kelvin
Sent: Tuesday, January 29, 2013 11:49 AM
Subject: Re: Questions about FuzzyQuery in Lucene 4.x

Hi Jack,

Thanks for your reply!

I don't think I passed the prefixLength parameter in.

Here is the code I used to build the FuzzyQuery:

            String[] words = str.split("\\+");
            BooleanQuery query = new BooleanQuery();

            for (int i=0; i<words.length; i++)
                Term t = new Term(field, words[i]);
                FuzzyQuery fq = new FuzzyQuery(t, ed);
                query.add(fq, BooleanClause.Occur.MUST);

            int k = 10;
            TopDocs results =, k);

Does it look right to you?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message