Class ElasticsearchSearchProjectionBuilderFactory
- java.lang.Object
-
- org.hibernate.search.backend.elasticsearch.search.projection.impl.ElasticsearchSearchProjectionBuilderFactory
-
- All Implemented Interfaces:
SearchProjectionBuilderFactory
public class ElasticsearchSearchProjectionBuilderFactory extends Object implements SearchProjectionBuilderFactory
-
-
Constructor Summary
Constructors Constructor Description ElasticsearchSearchProjectionBuilderFactory(SearchProjectionBackendContext searchProjectionBackendContext, ElasticsearchSearchIndexScope<?> scope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> SearchProjection<T>byTypeName(Map<String,? extends SearchProjection<? extends T>> inners)CompositeProjectionBuildercomposite()<T> SearchProjection<T>constant(T value)SearchProjection<DocumentReference>documentReference()<T> SearchProjection<T>entityComposite(SearchProjection<T> delegate)<E> SearchProjection<E>entityLoading()<R> SearchProjection<R>entityReference()SearchProjection<com.google.gson.JsonObject>explanation()<I> SearchProjection<I>id(Class<I> requestedIdentifierType)SearchProjection<com.google.gson.JsonObject>jsonHit()SearchProjection<Float>score()SearchProjection<com.google.gson.JsonObject>source()<T> SearchProjection<T>throwing(Supplier<SearchException> exceptionSupplier)
-
-
-
Constructor Detail
-
ElasticsearchSearchProjectionBuilderFactory
public ElasticsearchSearchProjectionBuilderFactory(SearchProjectionBackendContext searchProjectionBackendContext, ElasticsearchSearchIndexScope<?> scope)
-
-
Method Detail
-
documentReference
public SearchProjection<DocumentReference> documentReference()
- Specified by:
documentReferencein interfaceSearchProjectionBuilderFactory
-
entityLoading
public <E> SearchProjection<E> entityLoading()
- Specified by:
entityLoadingin interfaceSearchProjectionBuilderFactory
-
entityReference
public <R> SearchProjection<R> entityReference()
- Specified by:
entityReferencein interfaceSearchProjectionBuilderFactory
-
id
public <I> SearchProjection<I> id(Class<I> requestedIdentifierType)
- Specified by:
idin interfaceSearchProjectionBuilderFactory
-
score
public SearchProjection<Float> score()
- Specified by:
scorein interfaceSearchProjectionBuilderFactory
-
composite
public CompositeProjectionBuilder composite()
- Specified by:
compositein interfaceSearchProjectionBuilderFactory
-
constant
public <T> SearchProjection<T> constant(T value)
- Specified by:
constantin interfaceSearchProjectionBuilderFactory
-
entityComposite
public <T> SearchProjection<T> entityComposite(SearchProjection<T> delegate)
- Specified by:
entityCompositein interfaceSearchProjectionBuilderFactory
-
throwing
public <T> SearchProjection<T> throwing(Supplier<SearchException> exceptionSupplier)
- Specified by:
throwingin interfaceSearchProjectionBuilderFactory- Type Parameters:
T- The type of projected values.- Parameters:
exceptionSupplier- A supplier of the exception to throw.- Returns:
- A projection that throws an exception as soon as it's applied to at least one document.
-
byTypeName
public <T> SearchProjection<T> byTypeName(Map<String,? extends SearchProjection<? extends T>> inners)
- Specified by:
byTypeNamein interfaceSearchProjectionBuilderFactory- Type Parameters:
T- The type of projected values.- Parameters:
inners- A map from type name to projection.- Returns:
- A projection that delegates to the given projections, picking the delegate based on the document's type name.
-
source
public SearchProjection<com.google.gson.JsonObject> source()
-
explanation
public SearchProjection<com.google.gson.JsonObject> explanation()
-
jsonHit
public SearchProjection<com.google.gson.JsonObject> jsonHit()
-
-