java.lang.Object
org.elasticsearch.compute.operator.lookup.QueryList
- All Implemented Interfaces:
LookupEnrichQueryGenerator
Generates a list of Lucene queries based on the input block.
Each QueryList stores a channel offset to extract the correct Block from the Page.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AliasFilterprotected final intprotected final MappedFieldTypeprotected final QueryList.OnlySingleValueParams -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset, QueryList.OnlySingleValueParams onlySingleValueParams) -
Method Summary
Modifier and TypeMethodDescriptionstatic BiFunction<Block, Integer, Object> createBlockValueReaderForType(ElementType elementType) Returns a function that reads values from a block given its element type.static QueryListdateNanosTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of term queries for the given field for date_nanos values.static QueryListdateTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of term queries for the given field for date values.abstract org.apache.lucene.search.QuerydoGetQuery(int position, int firstValueIndex, int valueCount, Block inputBlock, SearchExecutionContext searchExecutionContext) Returns the query at the given position.static QueryListgeoShapeQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of geo_shape queries for the given field.intgetPositionCount(Page inputPage) Returns the number of positions in this query list (same as input block position count).final org.apache.lucene.search.QuerygetQuery(int position, Page inputPage, SearchExecutionContext searchExecutionContext) Returns the query at the given position.static QueryListipTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of term queries for the given field for IP values.abstract QueryListonlySingleValues(Warnings warnings, String multiValueWarningMessage) Returns a copy of this query list that only returns queries for single-valued positions.static QueryListrawTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset, ElementType elementType) Returns a list of term queries for the given field and element type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.compute.operator.lookup.LookupEnrichQueryGenerator
getBulkKeywordLookup
-
Field Details
-
aliasFilter
-
field
-
channelOffset
protected final int channelOffset -
onlySingleValueParams
-
-
Constructor Details
-
QueryList
protected QueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset, QueryList.OnlySingleValueParams onlySingleValueParams)
-
-
Method Details
-
getPositionCount
Returns the number of positions in this query list (same as input block position count).- Specified by:
getPositionCountin interfaceLookupEnrichQueryGenerator
-
onlySingleValues
Returns a copy of this query list that only returns queries for single-valued positions. That is, it returns `null` queries for either multivalued or null positions.Whenever a multi-value position is encountered, whether in the input block or in the queried index, a warning is emitted.
-
getQuery
public final org.apache.lucene.search.Query getQuery(int position, Page inputPage, SearchExecutionContext searchExecutionContext) Description copied from interface:LookupEnrichQueryGeneratorReturns the query at the given position.- Specified by:
getQueryin interfaceLookupEnrichQueryGenerator
-
doGetQuery
@Nullable public abstract org.apache.lucene.search.Query doGetQuery(int position, int firstValueIndex, int valueCount, Block inputBlock, SearchExecutionContext searchExecutionContext) Returns the query at the given position. -
createBlockValueReaderForType
public static BiFunction<Block,Integer, createBlockValueReaderForTypeObject> (ElementType elementType) Returns a function that reads values from a block given its element type. The function takes the block and offset, and returns the value as anObject. -
rawTermQueryList
public static QueryList rawTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset, ElementType elementType) Returns a list of term queries for the given field and element type. -
ipTermQueryList
public static QueryList ipTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of term queries for the given field for IP values. -
dateTermQueryList
public static QueryList dateTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of term queries for the given field for date values. -
dateNanosTermQueryList
public static QueryList dateNanosTermQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of term queries for the given field for date_nanos values. -
geoShapeQueryList
public static QueryList geoShapeQueryList(MappedFieldType field, AliasFilter aliasFilter, int channelOffset) Returns a list of geo_shape queries for the given field.
-