public class MapperQueryParser
extends org.apache.lucene.queryparser.classic.QueryParser
MapperService in order to build smarter
queries based on the mapping information.
Also breaks fields with [type].[name] into a boolean query that must include the type as well as the query on the name.
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.collect.ImmutableMap<String,FieldQueryExtension> |
fieldQueryExtensions |
jj_nt, token, token_sourceAND_OPERATOR, field, OR_OPERATOR_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 |
|---|
MapperQueryParser(QueryParseContext parseContext) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.lucene.search.Query |
getBooleanQuery(List<org.apache.lucene.search.BooleanClause> clauses,
boolean disableCoord) |
org.apache.lucene.search.Query |
getFieldQuery(String field,
String queryText,
boolean quoted) |
protected org.apache.lucene.search.Query |
getFieldQuery(String field,
String queryText,
int slop) |
protected org.apache.lucene.search.Query |
getFuzzyQuery(String field,
String termStr,
String minSimilarity) |
protected org.apache.lucene.search.Query |
getPrefixQuery(String field,
String termStr) |
protected org.apache.lucene.search.Query |
getRangeQuery(String field,
String part1,
String part2,
boolean startInclusive,
boolean endInclusive) |
protected org.apache.lucene.search.Query |
getRegexpQuery(String field,
String termStr) |
protected org.apache.lucene.search.Query |
getWildcardQuery(String field,
String termStr) |
protected org.apache.lucene.search.Query |
newFuzzyQuery(org.apache.lucene.index.Term term,
float minimumSimilarity,
int prefixLength) |
protected org.apache.lucene.search.Query |
newMatchAllDocsQuery() |
protected org.apache.lucene.search.Query |
newTermQuery(org.apache.lucene.index.Term term) |
org.apache.lucene.search.Query |
parse(String query) |
void |
reset(QueryParserSettings settings) |
Clause, Conjunction, disable_tracing, enable_tracing, generateParseException, getNextToken, getToken, Modifiers, Query, ReInit, ReInit, Term, TopLevelQueryaddClause, analyzeMultitermTerm, escape, getAllowLeadingWildcard, getAnalyzeRangeTerms, getAutoGeneratePhraseQueries, getBooleanQuery, getDateResolution, getDefaultOperator, getField, getFuzzyMinSim, getFuzzyPrefixLength, getFuzzyQuery, getLocale, getLowercaseExpandedTerms, getMaxDeterminizedStates, getMultiTermRewriteMethod, getPhraseSlop, getTimeZone, init, newBooleanClause, newFieldQuery, newPrefixQuery, newRangeQuery, newRegexpQuery, newWildcardQuery, setAllowLeadingWildcard, setAnalyzeRangeTerms, setAutoGeneratePhraseQueries, setDateResolution, setDateResolution, setDefaultOperator, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setLowercaseExpandedTerms, setMaxDeterminizedStates, setMultiTermRewriteMethod, setPhraseSlop, setTimeZonecreateBooleanQuery, createBooleanQuery, createFieldQuery, createMinShouldMatchQuery, createPhraseQuery, createPhraseQuery, getAnalyzer, getEnablePositionIncrements, newBooleanQuery, newMultiPhraseQuery, setAnalyzer, setEnablePositionIncrementspublic static final com.google.common.collect.ImmutableMap<String,FieldQueryExtension> fieldQueryExtensions
public MapperQueryParser(QueryParseContext parseContext)
public void reset(QueryParserSettings settings)
protected org.apache.lucene.search.Query newTermQuery(org.apache.lucene.index.Term term)
newTermQuery in class org.apache.lucene.util.QueryBuilderprotected org.apache.lucene.search.Query newMatchAllDocsQuery()
newMatchAllDocsQuery in class org.apache.lucene.queryparser.classic.QueryParserBasepublic org.apache.lucene.search.Query getFieldQuery(String field, String queryText, boolean quoted) throws org.apache.lucene.queryparser.classic.ParseException
getFieldQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionprotected org.apache.lucene.search.Query getFieldQuery(String field, String queryText, int slop) throws org.apache.lucene.queryparser.classic.ParseException
getFieldQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionprotected org.apache.lucene.search.Query getRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) throws org.apache.lucene.queryparser.classic.ParseException
getRangeQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionprotected org.apache.lucene.search.Query getFuzzyQuery(String field, String termStr, String minSimilarity) throws org.apache.lucene.queryparser.classic.ParseException
org.apache.lucene.queryparser.classic.ParseExceptionprotected org.apache.lucene.search.Query newFuzzyQuery(org.apache.lucene.index.Term term,
float minimumSimilarity,
int prefixLength)
newFuzzyQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseprotected org.apache.lucene.search.Query getPrefixQuery(String field, String termStr) throws org.apache.lucene.queryparser.classic.ParseException
getPrefixQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionprotected org.apache.lucene.search.Query getWildcardQuery(String field, String termStr) throws org.apache.lucene.queryparser.classic.ParseException
getWildcardQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionprotected org.apache.lucene.search.Query getRegexpQuery(String field, String termStr) throws org.apache.lucene.queryparser.classic.ParseException
getRegexpQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionprotected org.apache.lucene.search.Query getBooleanQuery(List<org.apache.lucene.search.BooleanClause> clauses, boolean disableCoord) throws org.apache.lucene.queryparser.classic.ParseException
getBooleanQuery in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionpublic org.apache.lucene.search.Query parse(String query) throws org.apache.lucene.queryparser.classic.ParseException
parse in class org.apache.lucene.queryparser.classic.QueryParserBaseorg.apache.lucene.queryparser.classic.ParseExceptionCopyright © 2009–2017. All rights reserved.