Class LuceneOptimizedQueryParser
java.lang.Object
org.apache.lucene.util.QueryBuilder
org.apache.lucene.queryparser.classic.QueryParserBase
org.apache.lucene.queryparser.classic.QueryParser
com.apple.foundationdb.record.lucene.search.LuceneOptimizedQueryParser
- All Implemented Interfaces:
ConfigAwareQueryParser,org.apache.lucene.queryparser.classic.QueryParserConstants,org.apache.lucene.queryparser.flexible.standard.CommonQueryParserConfiguration
- Direct Known Subclasses:
LuceneOptimizedStopWordsQueryParser
public class LuceneOptimizedQueryParser
extends org.apache.lucene.queryparser.classic.QueryParser
implements ConfigAwareQueryParser
Optimized
QueryParser that adds the slop for SpanNearQuery as well.
So the proximity search based on SpanNearQuery can also work.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.queryparser.classic.QueryParser
org.apache.lucene.queryparser.classic.QueryParser.OperatorNested classes/interfaces inherited from class org.apache.lucene.util.QueryBuilder
org.apache.lucene.util.QueryBuilder.TermAndBoost -
Field Summary
Fields inherited from class org.apache.lucene.queryparser.classic.QueryParser
DEFAULT_SPLIT_ON_WHITESPACE, jj_nt, token, token_sourceFields inherited from class org.apache.lucene.queryparser.classic.QueryParserBase
AND_OPERATOR, field, OR_OPERATORFields inherited from class org.apache.lucene.util.QueryBuilder
analyzer, autoGenerateMultiTermSynonymsPhraseQuery, enableGraphQueries, enablePositionIncrementsFields inherited from interface org.apache.lucene.queryparser.classic.QueryParserConstants
_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 Summary
ConstructorsConstructorDescriptionLuceneOptimizedQueryParser(String field, org.apache.lucene.analysis.Analyzer analyzer, Map<String, org.apache.lucene.queryparser.flexible.standard.config.PointsConfig> pointsConfig) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.QueryconstructFieldWithoutPointsConfig(String field, String queryText, boolean quoted) org.apache.lucene.search.QueryconstructRangeQueryWithoutPointsConfig(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) protected org.apache.lucene.search.QuerygetFieldQuery(String field, String queryText, boolean quoted) protected org.apache.lucene.search.QuerygetFieldQuery(String field, String queryText, int slop) protected org.apache.lucene.search.QuerygetRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) final org.apache.lucene.queryparser.classic.TokenMethods inherited from class org.apache.lucene.queryparser.classic.QueryParser
Clause, Conjunction, disable_tracing, enable_tracing, generateParseException, getNextToken, getSplitOnWhitespace, getToken, Modifiers, MultiTerm, Query, ReInit, ReInit, setAutoGeneratePhraseQueries, setSplitOnWhitespace, Term, TopLevelQueryMethods inherited from class org.apache.lucene.queryparser.classic.QueryParserBase
addClause, addMultiTermClauses, escape, getAllowLeadingWildcard, getAutoGeneratePhraseQueries, getBooleanQuery, getDateResolution, getDefaultOperator, getDeterminizeWorkLimit, getField, getFuzzyMinSim, getFuzzyPrefixLength, getFuzzyQuery, getLocale, getMultiTermRewriteMethod, getPhraseSlop, getPrefixQuery, getRegexpQuery, getTimeZone, getWildcardQuery, init, newBooleanClause, newFieldQuery, newFuzzyQuery, newMatchAllDocsQuery, newPrefixQuery, newRangeQuery, newRegexpQuery, newWildcardQuery, parse, setAllowLeadingWildcard, setDateResolution, setDateResolution, setDefaultOperator, setDeterminizeWorkLimit, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setMultiTermRewriteMethod, setPhraseSlop, setTimeZoneMethods inherited from class org.apache.lucene.util.QueryBuilder
add, analyzeBoolean, analyzeGraphBoolean, analyzeGraphPhrase, analyzeMultiBoolean, analyzeMultiPhrase, analyzePhrase, analyzeTerm, createBooleanQuery, createBooleanQuery, createFieldQuery, createFieldQuery, createMinShouldMatchQuery, createPhraseQuery, createPhraseQuery, createSpanQuery, getAnalyzer, getAutoGenerateMultiTermSynonymsPhraseQuery, getEnableGraphQueries, getEnablePositionIncrements, newBooleanQuery, newGraphSynonymQuery, newMultiPhraseQueryBuilder, newSynonymQuery, newTermQuery, setAnalyzer, setAutoGenerateMultiTermSynonymsPhraseQuery, setEnableGraphQueries, setEnablePositionIncrementsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.queryparser.flexible.standard.CommonQueryParserConfiguration
getAnalyzer, getEnablePositionIncrements, setEnablePositionIncrementsMethods inherited from interface com.apple.foundationdb.record.lucene.search.ConfigAwareQueryParser
addSlop, attemptConstructFieldQueryWithPointsConfig, attemptConstructRangeQueryWithPointsConfig
-
Constructor Details
-
LuceneOptimizedQueryParser
-
-
Method Details
-
getFieldQuery
protected org.apache.lucene.search.Query getFieldQuery(String field, String queryText, int slop) throws org.apache.lucene.queryparser.classic.ParseException - Overrides:
getFieldQueryin classorg.apache.lucene.queryparser.classic.QueryParserBase- Throws:
org.apache.lucene.queryparser.classic.ParseException
-
getFieldQuery
protected org.apache.lucene.search.Query getFieldQuery(String field, String queryText, boolean quoted) throws org.apache.lucene.queryparser.classic.ParseException - Overrides:
getFieldQueryin classorg.apache.lucene.queryparser.classic.QueryParserBase- Throws:
org.apache.lucene.queryparser.classic.ParseException
-
getRangeQuery
protected org.apache.lucene.search.Query getRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) throws org.apache.lucene.queryparser.classic.ParseException - Overrides:
getRangeQueryin classorg.apache.lucene.queryparser.classic.QueryParserBase- Throws:
org.apache.lucene.queryparser.classic.ParseException
-
getPointsConfig
@Nonnull public Map<String,org.apache.lucene.queryparser.flexible.standard.config.PointsConfig> getPointsConfig()- Specified by:
getPointsConfigin interfaceConfigAwareQueryParser
-
constructFieldWithoutPointsConfig
@Nonnull public org.apache.lucene.search.Query constructFieldWithoutPointsConfig(@Nonnull String field, @Nonnull String queryText, boolean quoted) throws org.apache.lucene.queryparser.classic.ParseException - Specified by:
constructFieldWithoutPointsConfigin interfaceConfigAwareQueryParser- Throws:
org.apache.lucene.queryparser.classic.ParseException
-
constructRangeQueryWithoutPointsConfig
@Nonnull public org.apache.lucene.search.Query constructRangeQueryWithoutPointsConfig(@Nonnull String field, @Nonnull String part1, @Nonnull String part2, boolean startInclusive, boolean endInclusive) throws org.apache.lucene.queryparser.classic.ParseException - Specified by:
constructRangeQueryWithoutPointsConfigin interfaceConfigAwareQueryParser- Throws:
org.apache.lucene.queryparser.classic.ParseException
-
nextToken
@Nonnull public final org.apache.lucene.queryparser.classic.Token nextToken()- Specified by:
nextTokenin interfaceConfigAwareQueryParser
-