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

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.

        Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to