java.lang.Object
org.elasticsearch.compute.operator.lookup.QueryList
All Implemented Interfaces:
LookupEnrichQueryGenerator

public abstract class QueryList extends Object implements 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.
  • Field Details

  • Constructor Details

  • Method Details

    • getPositionCount

      public int getPositionCount(Page inputPage)
      Returns the number of positions in this query list (same as input block position count).
      Specified by:
      getPositionCount in interface LookupEnrichQueryGenerator
    • onlySingleValues

      public abstract QueryList onlySingleValues(Warnings warnings, String multiValueWarningMessage)
      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: LookupEnrichQueryGenerator
      Returns the query at the given position.
      Specified by:
      getQuery in interface LookupEnrichQueryGenerator
    • 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,Object> createBlockValueReaderForType(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 an Object.
    • 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.