public abstract class QueryConverter extends Object implements NamedListInitializedPlugin
The QueryConverter is an abstract base class defining a method for converting input "raw" queries into a set of tokens for spell checking. It is used to "parse" the CommonParams.Q (the input query) and converts it to tokens.
It is only invoked for the CommonParams.Q parameter, and not the "spellcheck.q" parameter. Systems that use their own query parser or those that find issue with the basic implementation should implement their own QueryConverter instead of using the provided implementation (SpellingQueryConverter) by overriding the appropriate methods on the SpellingQueryConverter and registering it in the solrconfig.xml
Refer to SpellCheckComponent for more details
Constructor and Description |
---|
QueryConverter() |
Modifier and Type | Method and Description |
---|---|
abstract Collection<Token> |
convert(String original) |
Analyzer |
getAnalyzer() |
void |
init(NamedList args) |
void |
setAnalyzer(Analyzer analyzer)
Set the analyzer to use.
|
protected Analyzer analyzer
public void init(NamedList args)
init
in interface NamedListInitializedPlugin
public abstract Collection<Token> convert(String original)
original
- Token
s for
the query. Offsets on the Token should correspond to the correct
offset in the origQuerypublic void setAnalyzer(Analyzer analyzer)
analyzer
- public Analyzer getAnalyzer()