Class ElasticsearchSearchQueryImpl<H>
java.lang.Object
org.hibernate.search.engine.search.query.spi.AbstractSearchQuery<H,ElasticsearchSearchResult<H>>
org.hibernate.search.backend.elasticsearch.search.query.impl.ElasticsearchSearchQueryImpl<H>
- All Implemented Interfaces:
ElasticsearchSearchFetchable<H>,ElasticsearchSearchQuery<H>,ExtendedSearchFetchable<H,,ElasticsearchSearchResult<H>, ElasticsearchSearchScroll<H>> ExtendedSearchQuery<H,,ElasticsearchSearchResult<H>, ElasticsearchSearchScroll<H>> SearchFetchable<H>,SearchQuery<H>,SearchQueryImplementor<H>
public class ElasticsearchSearchQueryImpl<H>
extends AbstractSearchQuery<H,ElasticsearchSearchResult<H>>
implements ElasticsearchSearchQuery<H>
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectExplain score computation of this query for the document with the given id.com.google.gson.JsonObjectExplain score computation of this query for the document with the given id in the given mapped type.<Q> Qextension(SearchQueryExtension<Q, H> extension) Extend the current query with the given extension, resulting in an extended query offering more options or a more detailed result type.voidlongExecute the query and return the total hit count.scroll(int chunkSize) Execute the query continuously to deliver results in small chunks through aSearchScroll.toString()Methods inherited from class org.hibernate.search.engine.search.query.spi.AbstractSearchQuery
fetch, fetchAll, fetchAllHits, fetchHits, fetchSingleHitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.search.engine.search.query.ExtendedSearchFetchable
fetch, fetchAllMethods inherited from interface org.hibernate.search.engine.search.query.SearchFetchable
fetchAllHits, fetchHits, fetchSingleHit
-
Method Details
-
queryString
- Specified by:
queryStringin interfaceSearchQuery<H>- Returns:
- A textual representation of the query.
-
toString
- Overrides:
toStringin classAbstractSearchQuery<H,ElasticsearchSearchResult<H>>
-
extension
Description copied from interface:SearchQueryExtend the current query with the given extension, resulting in an extended query offering more options or a more detailed result type.- Specified by:
extensionin interfaceSearchQuery<H>- Type Parameters:
Q- The type of queries provided by the extension.- Parameters:
extension- The extension to the predicate DSL.- Returns:
- The extended query.
-
fetch
Description copied from interface:SearchFetchable- Specified by:
fetchin interfaceExtendedSearchFetchable<H,ElasticsearchSearchResult<H>, ElasticsearchSearchScroll<H>> - Specified by:
fetchin interfaceSearchFetchable<H>- Specified by:
fetchin classAbstractSearchQuery<H,ElasticsearchSearchResult<H>> - Parameters:
offset- The number of hits to skip before adding the hits to theSearchResult.nullmeans no offset.limit- The maximum number of hits to be included in theSearchResult.nullmeans no limit.- Returns:
- The
SearchResult.
-
fetchHits
Description copied from interface:SearchFetchable- Specified by:
fetchHitsin interfaceSearchFetchable<H>- Parameters:
offset- The number of hits to skip.nullmeans no offset.limit- The maximum number of hits to be returned by this method.nullmeans no limit.- Returns:
- The query hits.
-
fetchTotalHitCount
public long fetchTotalHitCount()Description copied from interface:SearchFetchableExecute the query and return the total hit count.- Specified by:
fetchTotalHitCountin interfaceSearchFetchable<H>- Returns:
- The total number of matching entities, ignoring pagination settings.
-
scroll
Description copied from interface:SearchFetchableExecute the query continuously to deliver results in small chunks through aSearchScroll.Useful to process large datasets.
- Specified by:
scrollin interfaceExtendedSearchFetchable<H,ElasticsearchSearchResult<H>, ElasticsearchSearchScroll<H>> - Specified by:
scrollin interfaceSearchFetchable<H>- Parameters:
chunkSize- The maximum number of hits to be returned for each call toSearchScroll.next()- Returns:
- The
SearchScroll.
-
explain
Description copied from interface:ElasticsearchSearchQueryExplain score computation of this query for the document with the given id.This is a shorthand for
ElasticsearchSearchQuery.explain(String, Object)when the query only targets one index.- Specified by:
explainin interfaceElasticsearchSearchQuery<H>- Parameters:
id- The id of the entity whose score should be explained. This is the entity ID, which may be of any type (long, ...), not the document ID which is always a string.- Returns:
- A
JsonObjectdescribing the score computation for the hit.
-
explain
Description copied from interface:ElasticsearchSearchQueryExplain score computation of this query for the document with the given id in the given mapped type.This feature is relatively expensive, use it only sparingly and when you need to debug a slow query.
- Specified by:
explainin interfaceElasticsearchSearchQuery<H>- Parameters:
typeName- The name of the type of the entity whose score should be explained.id- The id of the entity whose score should be explained. This is the entity ID, which may be of any type (long, ...), not the document ID which is always a string.- Returns:
- A
JsonObjectdescribing the score computation for the hit.
-
failAfter
- Specified by:
failAfterin interfaceSearchQueryImplementor<H>
-