Interface FieldValues<T>


public interface FieldValues<T>
Represents values for a given document
  • Method Details

    • valuesForDoc

      void valuesForDoc(SearchLookup lookup, org.apache.lucene.index.LeafReaderContext ctx, int doc, Consumer<T> consumer)
      Loads the values for the given document and passes them to the consumer
      Parameters:
      lookup - a search lookup to access values from
      ctx - the LeafReaderContext containing the document
      doc - the docid
      consumer - called with each document value
    • valueFetcher

      static ValueFetcher valueFetcher(FieldValues<?> fieldValues, SearchExecutionContext context)
      Creates a ValueFetcher that fetches values from a FieldValues instance
      Parameters:
      fieldValues - the source of the values
      context - the search execution context
      Returns:
      the value fetcher
    • valueFetcher

      static ValueFetcher valueFetcher(FieldValues<?> fieldValues, Function<Object,Object> formatter, SearchExecutionContext context)
      Creates a ValueFetcher that fetches values from a FieldValues instance
      Parameters:
      fieldValues - the source of the values
      formatter - a function to format the values
      context - the search execution context
      Returns:
      the value fetcher
    • valueListFetcher

      static <T> ValueFetcher valueListFetcher(FieldValues<T> fieldValues, Function<List<T>,List<Object>> formatter, SearchExecutionContext context)
      Creates a ValueFetcher that fetches values from a FieldValues instance
      Parameters:
      fieldValues - the source of the values
      formatter - a function to format the list values
      context - the search execution context
      Returns:
      the value fetcher