Interface LuceneSearchProjection.Extractor<E,P>
-
- Type Parameters:
E- The type of temporary values extracted from the response. May be the same asLuceneSearchProjection.Extractor, or not, depending on implementation.P- The type of projected values.
- All Known Implementing Classes:
LuceneConstantProjection,LuceneEntityLoadingProjection,LuceneEntityReferenceProjection,LuceneIdProjection,LuceneThrowingProjection
- Enclosing interface:
- LuceneSearchProjection<P>
public static interface LuceneSearchProjection.Extractor<E,P>An object responsible for extracting data from the Lucene Searcher, to implement a projection.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Ptransform(LoadingResult<?> loadingResult, E extractedData, ProjectionTransformContext context)Transforms the extracted data to the actual projection result.static <Z> ZtransformUnsafe(LuceneSearchProjection.Extractor<?,Z> extractor, LoadingResult<?> loadingResult, Object extractedData, ProjectionTransformContext context)Transforms the extracted data and casts it to the right type.Values<E>values(ProjectionExtractContext context)Creates low-level values for use in aTopDocsDataCollector.
-
-
-
Method Detail
-
values
Values<E> values(ProjectionExtractContext context)
Creates low-level values for use in aTopDocsDataCollector.The returned
Valuesshould only perform operations relative to extracting content from the index, delaying operations that rely on the mapper untiltransform(LoadingResult, Object, ProjectionTransformContext)is called, so that blocking mapper operations (if any) do not pollute backend threads.- Parameters:
context- An execution context for the extraction.- Returns:
- The
Valuesto use during Lucene collection of top docs data.
-
transform
P transform(LoadingResult<?> loadingResult, E extractedData, ProjectionTransformContext context)
Transforms the extracted data to the actual projection result.- Parameters:
loadingResult- Container containing all the entities that have been loaded by theProjectionHitMapper.extractedData- The extracted data to transform, returned by thevalue source.context- An execution context for the transforming.- Returns:
- The final result considered as a hit.
-
transformUnsafe
static <Z> Z transformUnsafe(LuceneSearchProjection.Extractor<?,Z> extractor, LoadingResult<?> loadingResult, Object extractedData, ProjectionTransformContext context)
Transforms the extracted data and casts it to the right type.This should be used with care as it's unsafe.
-
-