org.apache.solr.spelling
public class SpellingQueryConverter extends QueryConverter
Token with the QueryConverter.REQUIRED_TERM_FLAG set.
Prohibited terms output a Token with the QueryConverter.PROHIBITED_TERM_FLAG
set. If the query uses the plus (+) and minus (-) to denote required and prohibited, this
determination will be accurate. In the case boolean AND/OR/NOTs are used, this
converter makes an uninformed guess as to whether the term would likely behave as if it
is Required or Prohibited and sets the flags accordingly. These flags are used downstream
to generate collations for WordBreakSolrSpellChecker, in cases where an original
term is split up into multiple Tokens.| Modifier and Type | Field and Description |
|---|---|
protected Pattern |
QUERY_REGEX |
analyzer, PROHIBITED_TERM_FLAG, REQUIRED_TERM_FLAG, TERM_IN_BOOLEAN_QUERY_FLAG, TERM_PRECEDES_NEW_BOOLEAN_OPERATOR_FLAG| Constructor and Description |
|---|
SpellingQueryConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
analyze(Collection<Token> result,
String text,
int offset,
int flagsAttValue) |
Collection<Token> |
convert(String original)
Converts the original query string to a collection of Lucene Tokens.
|
getAnalyzer, init, setAnalyzerprotected Pattern QUERY_REGEX
public Collection<Token> convert(String original)
convert in class QueryConverteroriginal - the original query stringprotected void analyze(Collection<Token> result, String text, int offset, int flagsAttValue) throws IOException
IOExceptionCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.