lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Edit-distance strategy
Date Thu, 08 Jun 2006 13:48:52 GMT
On Jun 8, 2006, at 7:11 AM, karl wettin wrote:
> I'm about to replace the edit-distance algorithm in FuzzyQuery from
> Levenstein to Hirschberg to save a couple of clockticks.
> Any thoughts on how to give FuzzyQuery a strategy without changing the
> API? I can't figure it out and might just replace the algorithm in
> FuzzyTermEnum to run on Hirschberg instead. The outcome is pretty much
> the same, so perhaps it is overkill to have the old Levenstein sitting
> around.

Untested, but what about subclassing FuzzyQuery and overriding  
getEnum with your own FilteredTermEnum?   Seems like that that'd do  
the trick.

> But still, it would be nice if it was a setting. But then how do I
> change the setting from QueryParser and all the other classes that
> depend on FuzzyQuery as it is now?

Well now, that's a different story :)   But the way I look at it is  
that QueryParser is already the kitchen sink and none of my  
applications rely heavily on it.  Field selection and all the other  
tricky things with QueryParser syntax are handled in our user  
interfaces more implicitly.

There really aren't "all" that many other classes are there?   

You can subclass QueryParser and override getFuzzyQuery() and plug in  
your custom one there.

Sure, its not as "pluggable" in this area as one would perhaps  
expect.  But query parsing is an area where one size really doesn't  
fit all.


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

View raw message