Class ElasticsearchEntityLoadingProjection<E>
- java.lang.Object
-
- org.hibernate.search.backend.elasticsearch.search.projection.impl.AbstractElasticsearchProjection<E>
-
- org.hibernate.search.backend.elasticsearch.search.projection.impl.ElasticsearchEntityLoadingProjection<E>
-
- All Implemented Interfaces:
ElasticsearchSearchProjection<E>,ElasticsearchSearchProjection.Extractor<Object,E>,SearchProjection<E>
public class ElasticsearchEntityLoadingProjection<E> extends AbstractElasticsearchProjection<E> implements ElasticsearchSearchProjection.Extractor<Object,E>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.search.backend.elasticsearch.search.projection.impl.AbstractElasticsearchProjection
AbstractElasticsearchProjection.AbstractBuilder<P>
-
Nested classes/interfaces inherited from interface org.hibernate.search.backend.elasticsearch.search.projection.impl.ElasticsearchSearchProjection
ElasticsearchSearchProjection.Extractor<E,P>
-
-
Field Summary
-
Fields inherited from class org.hibernate.search.backend.elasticsearch.search.projection.impl.AbstractElasticsearchProjection
indexNames
-
Fields inherited from interface org.hibernate.search.backend.elasticsearch.search.projection.impl.ElasticsearchSearchProjection
log
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectextract(ProjectionHitMapper<?> projectionHitMapper, com.google.gson.JsonObject hit, com.google.gson.JsonObject source, ProjectionExtractContext context)Performs hit extraction.ElasticsearchSearchProjection.Extractor<?,E>request(com.google.gson.JsonObject requestBody, ProjectionRequestContext context)Contributes to the request, making sure that the requirements for this projection are met, and creating anElasticsearchSearchProjection.Extractorthat will be able to extract the result of the projection from the Elasticsearch response.StringtoString()Etransform(LoadingResult<?> loadingResult, Object extractedData, ProjectionTransformContext context)Transforms the extracted data to the actual projection result.-
Methods inherited from class org.hibernate.search.backend.elasticsearch.search.projection.impl.AbstractElasticsearchProjection
indexNames
-
-
-
-
Method Detail
-
request
public ElasticsearchSearchProjection.Extractor<?,E> request(com.google.gson.JsonObject requestBody, ProjectionRequestContext context)
Description copied from interface:ElasticsearchSearchProjectionContributes to the request, making sure that the requirements for this projection are met, and creating anElasticsearchSearchProjection.Extractorthat will be able to extract the result of the projection from the Elasticsearch response.- Specified by:
requestin interfaceElasticsearchSearchProjection<E>- Parameters:
requestBody- The request body.context- An execution context for the request.- Returns:
- An
ElasticsearchSearchProjection.Extractor, to extract the result of the projection from the Elasticsearch response.
-
extract
public Object extract(ProjectionHitMapper<?> projectionHitMapper, com.google.gson.JsonObject hit, com.google.gson.JsonObject source, ProjectionExtractContext context)
Description copied from interface:ElasticsearchSearchProjection.ExtractorPerforms hit extraction.Implementations should only perform operations relative to extracting content from the index, delaying operations that rely on the mapper until
ElasticsearchSearchProjection.Extractor.transform(LoadingResult, Object, ProjectionTransformContext)is called, so that blocking mapper operations (if any) do not pollute backend threads.- Specified by:
extractin interfaceElasticsearchSearchProjection.Extractor<Object,E>- Parameters:
projectionHitMapper- The projection hit mapper used to transform hits to entities.hit- The part of the response body relevant to the hit to extract.source- The part of the source that this extractor should extract from (if relevant).context- An execution context for the extraction.- Returns:
- The element extracted from the hit. Might be a key referring to an object that will be loaded by the
ProjectionHitMapper. This returned object will be passed toElasticsearchSearchProjection.Extractor.transform(LoadingResult, Object, ProjectionTransformContext).
-
transform
public E transform(LoadingResult<?> loadingResult, Object extractedData, ProjectionTransformContext context)
Description copied from interface:ElasticsearchSearchProjection.ExtractorTransforms the extracted data to the actual projection result.- Specified by:
transformin interfaceElasticsearchSearchProjection.Extractor<Object,E>- Parameters:
loadingResult- Container containing all the entities that have been loaded by theProjectionHitMapper.extractedData- The extracted data to transform, coming from theElasticsearchSearchProjection.Extractor.extract(ProjectionHitMapper, JsonObject, JsonObject, ProjectionExtractContext)method.context- An execution context for the transforming.- Returns:
- The final result considered as a hit.
-
-