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 Summary
Nested classes/interfaces inherited from class com.apple.foundationdb.record.lucene.LuceneQueryClause
LuceneQueryClause.BoundQuery
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.PlanHashable
PlanHashable.PlanHashKind, PlanHashable.PlanHashMode
-
Field Summary
FieldsFields inherited from interface com.apple.foundationdb.record.PlanHashable
CURRENT_FOR_CONTINUATION, CURRENT_LEGACY
-
Constructor Summary
ConstructorsConstructorDescriptionLuceneAutoCompleteQueryClause
(String search, boolean isParameter, Iterable<String> fields) -
Method Summary
Modifier and TypeMethodDescriptionbind
(FDBRecordStoreBase<?> store, Index index, EvaluationContext context) static org.apache.lucene.search.Query
buildPhraseQueryWithPrefix
(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.Query
buildQueryForPhraseMatching
(org.apache.lucene.queryparser.classic.QueryParser parser, Collection<String> fieldNames, String searchKey) boolean
void
getPlannerGraphDetails
(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) int
hashCode()
boolean
int
toString()
Methods inherited from class com.apple.foundationdb.record.lucene.LuceneQueryClause
combineHighlightingTermsMaps, getHighlightingTermsMap, getQueryType, toBoundQuery
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.apple.foundationdb.record.PlanHashable
planHash, planHash
-
Field Details
-
LOGGER
public static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
LuceneAutoCompleteQueryClause
-
-
Method Details
-
getSearch
-
isParameter
public boolean isParameter() -
bind
public LuceneQueryClause.BoundQuery bind(@Nonnull FDBRecordStoreBase<?> store, @Nonnull Index index, @Nonnull EvaluationContext context) - Specified by:
bind
in classLuceneQueryClause
-
getPlannerGraphDetails
public 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:
getPlannerGraphDetails
in classLuceneQueryClause
-
planHash
-
toString
-
equals
-
hashCode
public 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 analyzerfieldNames
- the fields to match againstphrase
- the phrase part of the search keyprefix
- the prefix (last token) of the search keyuseGapForPrefix
- 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)
-