org.apache.solr.spelling
Class QueryConverter
java.lang.Object
org.apache.solr.spelling.QueryConverter
- All Implemented Interfaces:
- NamedListInitializedPlugin
- Direct Known Subclasses:
- SpellingQueryConverter
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
- Since:
- solr 1.3
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
analyzer
protected Analyzer analyzer
QueryConverter
public QueryConverter()
init
public void init(NamedList args)
- Specified by:
init
in interface NamedListInitializedPlugin
convert
public abstract Collection<Token> convert(String original)
- Parameters:
original
-
- Returns:
- The Collection of
Token
s for
the query. Offsets on the Token should correspond to the correct
offset in the origQuery
setAnalyzer
public void setAnalyzer(Analyzer analyzer)
- Set the analyzer to use. Must be set before any calls to convert.
- Parameters:
analyzer
-
getAnalyzer
public Analyzer getAnalyzer()
Copyright © 2010 Apache Software Foundation. All Rights Reserved.