public class SpellSuggestQueryParser
extends org.apache.lucene.queryparser.classic.QueryParser
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
DEFAULT_SPLIT_ON_WHITESPACE, jj_nt, token, token_source
AND_OPERATOR, field, OR_OPERATOR
analyzer, enableGraphQueries, enablePositionIncrements
_ESCAPED_CHAR, _NUM_CHAR, _QUOTED_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AND, BAREOPER, Boost, CARAT, COLON, DEFAULT, EOF, FUZZY_SLOP, LPAREN, MINUS, NOT, NUMBER, OR, PLUS, PREFIXTERM, QUOTED, Range, RANGE_GOOP, RANGE_QUOTED, RANGE_TO, RANGEEX_END, RANGEEX_START, RANGEIN_END, RANGEIN_START, REGEXPTERM, RPAREN, STAR, TERM, tokenImage, WILDTERM
Constructor and Description |
---|
SpellSuggestQueryParser(java.lang.String field,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.search.spell.SpellChecker spellChecker,
org.apache.lucene.index.IndexReader reader)
Construct a new SpellSuggestQueryParser using the given params.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasSuggestedQuery()
Check if the suggestions were used during last parse.
|
protected org.apache.lucene.search.Query |
newTermQuery(org.apache.lucene.index.Term term) |
Clause, Conjunction, disable_tracing, enable_tracing, generateParseException, getNextToken, getSplitOnWhitespace, getToken, Modifiers, MultiTerm, Query, ReInit, ReInit, setAutoGeneratePhraseQueries, setSplitOnWhitespace, Term, TopLevelQuery
addClause, addMultiTermClauses, escape, getAllowLeadingWildcard, getAnalyzeRangeTerms, getAutoGeneratePhraseQueries, getBooleanQuery, getDateResolution, getDefaultOperator, getField, getFieldQuery, getFieldQuery, getFuzzyMinSim, getFuzzyPrefixLength, getFuzzyQuery, getLocale, getLowercaseExpandedTerms, getMaxDeterminizedStates, getMultiTermRewriteMethod, getPhraseSlop, getPrefixQuery, getRangeQuery, getRegexpQuery, getTimeZone, getWildcardQuery, init, newBooleanClause, newFieldQuery, newFuzzyQuery, newMatchAllDocsQuery, newPrefixQuery, newRangeQuery, newRegexpQuery, newWildcardQuery, parse, setAllowLeadingWildcard, setAnalyzeRangeTerms, setDateResolution, setDateResolution, setDefaultOperator, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setLowercaseExpandedTerms, setMaxDeterminizedStates, setMultiTermRewriteMethod, setPhraseSlop, setTimeZone
add, analyzeBoolean, analyzeGraph, analyzeMultiBoolean, analyzeMultiPhrase, analyzePhrase, analyzeTerm, createBooleanQuery, createBooleanQuery, createFieldQuery, createFieldQuery, createMinShouldMatchQuery, createPhraseQuery, createPhraseQuery, getAnalyzer, getEnableGraphQueries, getEnablePositionIncrements, newBooleanQuery, newMultiPhraseQueryBuilder, newSynonymQuery, setAnalyzer, setEnableGraphQueries, setEnablePositionIncrements
public static final java.lang.String REVISION
public SpellSuggestQueryParser(java.lang.String field, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.spell.SpellChecker spellChecker, org.apache.lucene.index.IndexReader reader)
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, SuggestMode)
.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, SuggestMode)
,
allows suggestion to be made only if the suggested term is more frequent in
the index than the searched term.protected org.apache.lucene.search.Query newTermQuery(org.apache.lucene.index.Term term)
newTermQuery
in class org.apache.lucene.util.QueryBuilder
public boolean hasSuggestedQuery()
Copyright © 2001-2017 Jalios SA. All Rights Reserved.