Class LuceneConstantProjection<T>
java.lang.Object
org.hibernate.search.backend.lucene.search.projection.impl.LuceneConstantProjection<T>
- All Implemented Interfaces:
Values<T>,LuceneSearchProjection<T>,LuceneSearchProjection.Extractor<T,,T> SearchProjection<T>
public class LuceneConstantProjection<T>
extends Object
implements LuceneSearchProjection.Extractor<T,T>, Values<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.search.backend.lucene.search.projection.impl.LuceneSearchProjection
LuceneSearchProjection.Extractor<E,P> -
Field Summary
Fields inherited from interface org.hibernate.search.backend.lucene.search.projection.impl.LuceneSearchProjection
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontext(org.apache.lucene.index.LeafReaderContext context) Sets the context to use for the next calls toValues.get(int).get(int doc) request(ProjectionRequestContext context) Request the collection of per-document data that will be used inLuceneSearchProjection.Extractor.values(ProjectionExtractContext), making sure that the requirements for this projection are met.transform(LoadingResult<?> loadingResult, T extractedData, ProjectionTransformContext context) Transforms the extracted data to the actual projection result.values(ProjectionExtractContext context) Creates low-level values for use in aTopDocsDataCollector.
-
Constructor Details
-
LuceneConstantProjection
-
-
Method Details
-
request
Description copied from interface:LuceneSearchProjectionRequest the collection of per-document data that will be used inLuceneSearchProjection.Extractor.values(ProjectionExtractContext), making sure that the requirements for this projection are met.- Specified by:
requestin interfaceLuceneSearchProjection<T>- Parameters:
context- An execution context for the request.- Returns:
- An
LuceneSearchProjection.Extractor, to extract the result of the projection from the Elasticsearch response.
-
values
Description copied from interface:LuceneSearchProjection.ExtractorCreates 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 untilLuceneSearchProjection.Extractor.transform(LoadingResult, Object, ProjectionTransformContext)is called, so that blocking mapper operations (if any) do not pollute backend threads.- Specified by:
valuesin interfaceLuceneSearchProjection.Extractor<T,T> - Parameters:
context- An execution context for the extraction.- Returns:
- The
Valuesto use during Lucene collection of top docs data.
-
context
Description copied from interface:ValuesSets the context to use for the next calls toValues.get(int).- Specified by:
contextin interfaceValues<T>- Parameters:
context- ALeafReaderContext.- Throws:
IOException- If an underlying I/O operation fails.
-
get
- Specified by:
getin interfaceValues<T>- Returns:
- The value for the given document in the current leaf.
- Throws:
IOException- If an underlying I/O operation fails.
-
transform
public T transform(LoadingResult<?> loadingResult, T extractedData, ProjectionTransformContext context) Description copied from interface:LuceneSearchProjection.ExtractorTransforms the extracted data to the actual projection result.- Specified by:
transformin interfaceLuceneSearchProjection.Extractor<T,T> - 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.
-
indexNames
- Specified by:
indexNamesin interfaceLuceneSearchProjection<P>
-