Class LuceneThrowingProjection<T>
- java.lang.Object
-
- org.hibernate.search.backend.lucene.search.projection.impl.LuceneThrowingProjection<T>
-
- All Implemented Interfaces:
Values<Object>,LuceneSearchProjection<T>,LuceneSearchProjection.Extractor<Object,T>,SearchProjection<T>
public class LuceneThrowingProjection<T> extends Object implements LuceneSearchProjection.Extractor<Object,T>, Values<Object>
-
-
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 Constructor Description LuceneThrowingProjection(LuceneSearchIndexScope<?> scope, Supplier<SearchException> exceptionSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontext(org.apache.lucene.index.LeafReaderContext context)Sets the context to use for the next calls toValues.get(int).Objectget(int doc)Set<String>indexNames()LuceneSearchProjection.Extractor<?,T>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.Ttransform(LoadingResult<?> loadingResult, Object extractedData, ProjectionTransformContext context)Transforms the extracted data to the actual projection result.Values<Object>values(ProjectionExtractContext context)Creates low-level values for use in aTopDocsDataCollector.
-
-
-
Constructor Detail
-
LuceneThrowingProjection
public LuceneThrowingProjection(LuceneSearchIndexScope<?> scope, Supplier<SearchException> exceptionSupplier)
-
-
Method Detail
-
request
public LuceneSearchProjection.Extractor<?,T> request(ProjectionRequestContext context)
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
public Values<Object> values(ProjectionExtractContext context)
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<Object,T>- Parameters:
context- An execution context for the extraction.- Returns:
- The
Valuesto use during Lucene collection of top docs data.
-
context
public void context(org.apache.lucene.index.LeafReaderContext context) throws IOExceptionDescription 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
public Object get(int doc) throws IOException
- 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, Object extractedData, ProjectionTransformContext context)
Description copied from interface:LuceneSearchProjection.ExtractorTransforms the extracted data to the actual projection result.- Specified by:
transformin interfaceLuceneSearchProjection.Extractor<Object,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
public final Set<String> indexNames()
- Specified by:
indexNamesin interfaceLuceneSearchProjection<P>
-
-