You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by ahmed algohary <al...@gmail.com> on 2010/09/30 14:41:18 UTC

How Does Fuzzy Query Work ??

Hi all,

I wonder how lucene FuzzyQuery works as it seems to take much longer time
than a normal query. Does it generate all the possible terms and search for
them ??

--
Ahmed Elgohary

Re: How Does Fuzzy Query Work ??

Posted by Robert Muir <rc...@gmail.com>.
On Thu, Sep 30, 2010 at 8:41 AM, ahmed algohary <al...@gmail.com>wrote:

> Hi all,
>
> I wonder how lucene FuzzyQuery works as it seems to take much longer time
> than a normal query. Does it generate all the possible terms and search for
> them ??
>
>
In current versions of lucene it is documented to be slow: "Warning: this
query is not very scalable with its default prefix length of 0 - in this
case, *every* term will be enumerated and cause an edit score calculation."
http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/search/FuzzyQuery.html

If you want it to be faster, use lucene trunk, which uses a different, more
sophisticated algorithm:
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.16.652

-- 
Robert Muir
rcmuir@gmail.com