On 29-Nov-07, at 5:40 PM, Chris Hostetter wrote:
I'm not very familiar with the SpellCheckerRequestHandler, but i don't
think you are doing anything wrong.
a quick skim of the code indicates that the "q" param isn't being
analyzed
by that handler, so the raw input string is pased to the
SpellChecker.suggestSimilar method. This may or may not have been
intentional.
I personally can't think of
any reason why it wouldn't make sense to get the query analyzer for
the
termSourceField and use it to analyze the q param before getting
suggestions.
It does make some sense, but I'm not sure that it should be blindly
analyzed without adding logic to handle certain cases (like the
QueryParser does). What happens if the analyzer produces two
tokens? The spellchecker has to deal with this appropriately. Spell
checkers should be able to "reverse analyze" the suggestions as well,
so "Pyhton" gets corrected to "Python" and not "python". Similarly,
"ad-hco" should probably suggest "ad-hoc" and not "adhoc".
-Mike