Class LuceneAutoCompleteQueryClause
java.lang.Object
com.apple.foundationdb.record.lucene.LuceneQueryClause
com.apple.foundationdb.record.lucene.LuceneAutoCompleteQueryClause
- All Implemented Interfaces:
- PlanHashable
Auto complete query clause from string using Lucene search syntax.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.apple.foundationdb.record.lucene.LuceneQueryClauseLuceneQueryClause.BoundQueryNested classes/interfaces inherited from interface com.apple.foundationdb.record.PlanHashablePlanHashable.PlanHashKind, PlanHashable.PlanHashMode
- 
Field SummaryFieldsFields inherited from interface com.apple.foundationdb.record.PlanHashableCURRENT_FOR_CONTINUATION, CURRENT_LEGACY
- 
Constructor SummaryConstructorsConstructorDescriptionLuceneAutoCompleteQueryClause(String search, boolean isParameter, Iterable<String> fields) 
- 
Method SummaryModifier and TypeMethodDescriptionbind(FDBRecordStoreBase<?> store, Index index, EvaluationContext context) static org.apache.lucene.search.QuerybuildPhraseQueryWithPrefix(org.apache.lucene.queryparser.classic.QueryParser parser, Collection<String> fieldNames, String phrase, String prefix, boolean useGapForPrefix) Constructs a query to match a phrase search, with the last token treated as a prefix.static org.apache.lucene.search.QuerybuildQueryForPhraseMatching(org.apache.lucene.queryparser.classic.QueryParser parser, Collection<String> fieldNames, String searchKey) booleanvoidgetPlannerGraphDetails(com.google.common.collect.ImmutableList.Builder<String> detailsBuilder, com.google.common.collect.ImmutableMap.Builder<String, com.apple.foundationdb.record.query.plan.cascades.explain.Attribute> attributeMapBuilder) inthashCode()booleaninttoString()Methods inherited from class com.apple.foundationdb.record.lucene.LuceneQueryClausecombineHighlightingTermsMaps, getHighlightingTermsMap, getQueryType, toBoundQueryMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.apple.foundationdb.record.PlanHashableplanHash, planHash
- 
Field Details- 
LOGGERpublic static final org.slf4j.Logger LOGGER
 
- 
- 
Constructor Details- 
LuceneAutoCompleteQueryClause
 
- 
- 
Method Details- 
getSearch
- 
isParameterpublic boolean isParameter()
- 
bindpublic LuceneQueryClause.BoundQuery bind(@Nonnull FDBRecordStoreBase<?> store, @Nonnull Index index, @Nonnull EvaluationContext context) - Specified by:
- bindin class- LuceneQueryClause
 
- 
getPlannerGraphDetailspublic void getPlannerGraphDetails(@Nonnull com.google.common.collect.ImmutableList.Builder<String> detailsBuilder, @Nonnull com.google.common.collect.ImmutableMap.Builder<String, com.apple.foundationdb.record.query.plan.cascades.explain.Attribute> attributeMapBuilder) - Specified by:
- getPlannerGraphDetailsin class- LuceneQueryClause
 
- 
planHash
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
buildPhraseQueryWithPrefix@Nonnull public static org.apache.lucene.search.Query buildPhraseQueryWithPrefix(@Nonnull org.apache.lucene.queryparser.classic.QueryParser parser, @Nonnull Collection<String> fieldNames, @Nonnull String phrase, @Nullable String prefix, boolean useGapForPrefix) Constructs a query to match a phrase search, with the last token treated as a prefix. This is to match "united states of" against "United States of America"- Parameters:
- parser- Lucene parser with given fields and analyzer
- fieldNames- the fields to match against
- phrase- the phrase part of the search key
- prefix- the prefix (last token) of the search key
- useGapForPrefix- option to represent the last token as a gap (if it's a stopword)
- Returns:
- a Lucene Query that matches phrase using the last token as a prefix
 
- 
buildQueryForPhraseMatching@Nonnull public static org.apache.lucene.search.Query buildQueryForPhraseMatching(@Nonnull org.apache.lucene.queryparser.classic.QueryParser parser, @Nonnull Collection<String> fieldNames, @Nonnull String searchKey) 
 
-