public class SpellSuggestQueryParser
extends org.apache.lucene.queryParser.QueryParser
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
AND_OPERATOR, jj_nt, OR_OPERATOR, token, token_source
_ESCAPED_CHAR, _NUM_CHAR, _QUOTED_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AND, Boost, CARAT, COLON, DEFAULT, EOF, FUZZY_SLOP, LPAREN, MINUS, NOT, NUMBER, OR, PLUS, PREFIXTERM, QUOTED, RangeEx, RANGEEX_END, RANGEEX_GOOP, RANGEEX_QUOTED, RANGEEX_START, RANGEEX_TO, RangeIn, RANGEIN_END, RANGEIN_GOOP, RANGEIN_QUOTED, RANGEIN_START, RANGEIN_TO, RPAREN, STAR, TERM, tokenImage, WILDTERM
Constructor and Description |
---|
SpellSuggestQueryParser(java.lang.String field,
org.apache.lucene.analysis.Analyzer analyzer,
SpellChecker spellChecker,
org.apache.lucene.index.IndexReader reader,
QueryHandler qh)
Construct a new SpellSuggestQueryParser using the given params.
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.lucene.search.Query |
getFieldQuery(java.lang.String field,
java.lang.String queryText) |
boolean |
hasSuggestedQuery()
Check if the suggestions were used during last parse.
|
org.apache.lucene.search.Query |
parse(java.lang.String query) |
addClause, addClause, Clause, Conjunction, disable_tracing, enable_tracing, escape, generateParseException, getAllowLeadingWildcard, getAnalyzer, getBooleanQuery, getBooleanQuery, getBooleanQuery, getBooleanQuery, getDateResolution, getDefaultOperator, getEnablePositionIncrements, getField, getFieldQuery, getFuzzyMinSim, getFuzzyPrefixLength, getFuzzyQuery, getLocale, getLowercaseExpandedTerms, getMultiTermRewriteMethod, getNextToken, getPhraseSlop, getPrefixQuery, getRangeCollator, getRangeQuery, getToken, getUseOldRangeQuery, getWildcardQuery, main, Modifiers, newBooleanClause, newBooleanQuery, newFuzzyQuery, newMatchAllDocsQuery, newMultiPhraseQuery, newPhraseQuery, newPrefixQuery, newRangeQuery, newTermQuery, newWildcardQuery, Query, ReInit, ReInit, setAllowLeadingWildcard, setDateResolution, setDateResolution, setDefaultOperator, setEnablePositionIncrements, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setLowercaseExpandedTerms, setMultiTermRewriteMethod, setPhraseSlop, setRangeCollator, setUseOldRangeQuery, Term, TopLevelQuery
public static final java.lang.String REVISION
public SpellSuggestQueryParser(java.lang.String field, org.apache.lucene.analysis.Analyzer analyzer, SpellChecker spellChecker, org.apache.lucene.index.IndexReader reader, QueryHandler qh)
field
- default field to use (see QueryParser.QueryParser(java.lang.String, org.apache.lucene.analysis.Analyzer)
)
used also by the spell checker method
SpellChecker.suggestSimilar(String, int, IndexReader, String, boolean)
.analyzer
- analyzer to use (see QueryParser.QueryParser(java.lang.String, org.apache.lucene.analysis.Analyzer)
)spellChecker
- the spellChecker instance to find suggestion, MUST NOT BE NULL.reader
- the IndexReader to use when calling the spell checker method
SpellChecker.suggestSimilar(String, int, IndexReader, String, boolean)
,
allows suggestion to be made only if the suggested term is more frequent in
the index than the searched term.qh
- the QueryHandler that was used for this query.protected org.apache.lucene.search.Query getFieldQuery(java.lang.String field, java.lang.String queryText) throws org.apache.lucene.queryParser.ParseException
getFieldQuery
in class org.apache.lucene.queryParser.QueryParser
org.apache.lucene.queryParser.ParseException
public org.apache.lucene.search.Query parse(java.lang.String query) throws org.apache.lucene.queryParser.ParseException
parse
in class org.apache.lucene.queryParser.QueryParser
org.apache.lucene.queryParser.ParseException
public boolean hasSuggestedQuery()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.