Interface ElasticsearchSearchQuery<H>

All Superinterfaces:
ElasticsearchSearchFetchable<H>, org.hibernate.search.engine.search.query.ExtendedSearchFetchable<H,ElasticsearchSearchResult<H>,ElasticsearchSearchScroll<H>>, org.hibernate.search.engine.search.query.ExtendedSearchQuery<H,ElasticsearchSearchResult<H>,ElasticsearchSearchScroll<H>>, org.hibernate.search.engine.search.query.SearchFetchable<H>, org.hibernate.search.engine.search.query.SearchQuery<H>

public interface ElasticsearchSearchQuery<H> extends org.hibernate.search.engine.search.query.ExtendedSearchQuery<H,ElasticsearchSearchResult<H>,ElasticsearchSearchScroll<H>>, ElasticsearchSearchFetchable<H>
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.gson.JsonObject
    Explain score computation of this query for the document with the given id.
    com.google.gson.JsonObject
    explain(String typeName, Object id)
    Explain score computation of this query for the document with the given id in the given mapped type.

    Methods inherited from interface org.hibernate.search.engine.search.query.ExtendedSearchFetchable

    fetch, fetch, fetchAll, scroll

    Methods inherited from interface org.hibernate.search.engine.search.query.SearchFetchable

    fetchAllHits, fetchHits, fetchHits, fetchSingleHit, fetchTotalHitCount

    Methods inherited from interface org.hibernate.search.engine.search.query.SearchQuery

    extension, queryString
  • Method Details

    • explain

      com.google.gson.JsonObject explain(Object id)
      Explain score computation of this query for the document with the given id.

      This is a shorthand for explain(String, Object) when the query only targets one index.

      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 JsonObject describing the score computation for the hit.
      Throws:
      org.hibernate.search.util.common.SearchException - If the query targets multiple indexes, or if the explain request fails.
    • explain

      com.google.gson.JsonObject explain(String typeName, Object id)
      Explain 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.

      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 JsonObject describing the score computation for the hit.
      Throws:
      org.hibernate.search.util.common.SearchException - If the given mapped type name does not refer to a mapped name targeted by this query, or if the explain request fails.