public interface FieldValues<T>
Represents values for a given document
-
Method Summary
Modifier and TypeMethodDescriptionstatic ValueFetchervalueFetcher(FieldValues<?> fieldValues, Function<Object, Object> formatter, SearchExecutionContext context) Creates aValueFetcherthat fetches values from aFieldValuesinstancestatic ValueFetchervalueFetcher(FieldValues<?> fieldValues, SearchExecutionContext context) Creates aValueFetcherthat fetches values from aFieldValuesinstancestatic <T> ValueFetchervalueListFetcher(FieldValues<T> fieldValues, Function<List<T>, List<Object>> formatter, SearchExecutionContext context) Creates aValueFetcherthat fetches values from aFieldValuesinstancevoidvaluesForDoc(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
-
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 fromctx- the LeafReaderContext containing the documentdoc- the docidconsumer- called with each document value
-
valueFetcher
Creates aValueFetcherthat fetches values from aFieldValuesinstance- Parameters:
fieldValues- the source of the valuescontext- the search execution context- Returns:
- the value fetcher
-
valueFetcher
static ValueFetcher valueFetcher(FieldValues<?> fieldValues, Function<Object, Object> formatter, SearchExecutionContext context) Creates aValueFetcherthat fetches values from aFieldValuesinstance- Parameters:
fieldValues- the source of the valuesformatter- a function to format the valuescontext- 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 aValueFetcherthat fetches values from aFieldValuesinstance- Parameters:
fieldValues- the source of the valuesformatter- a function to format the list valuescontext- the search execution context- Returns:
- the value fetcher
-