Class ResponseBody<TDocument>

java.lang.Object
co.elastic.clients.elasticsearch.core.search.ResponseBody<TDocument>
All Implemented Interfaces:
JsonpSerializable
Direct Known Subclasses:
MultiSearchItem, ScrollResponse, SearchApplicationSearchResponse, SearchResponse

public abstract class ResponseBody<TDocument> extends Object implements JsonpSerializable
See Also:
  • Constructor Details

  • Method Details

    • took

      public final long took()
      Required - The number of milliseconds it took Elasticsearch to run the request. This value is calculated by measuring the time elapsed between receipt of a request on the coordinating node and the time at which the coordinating node is ready to send the response. It includes:
      • Communication time between the coordinating node and data nodes
      • Time the request spends in the search thread pool, queued for execution
      • Actual run time

      It does not include:

      • Time needed to send the request to Elasticsearch
      • Time needed to serialize the JSON response
      • Time needed to send the response to a client

      API name: took

    • timedOut

      public final boolean timedOut()
      Required - If true, the request timed out before completion; returned results may be partial or empty.

      API name: timed_out

    • shards

      public final ShardStatistics shards()
      Required - A count of shards used for the request.

      API name: _shards

    • hits

      public final HitsMetadata<TDocument> hits()
      Required - The returned documents and metadata.

      API name: hits

    • aggregations

      public final Map<String,Aggregate> aggregations()
      API name: aggregations
    • clusters

      @Nullable public final ClusterStatistics clusters()
      API name: _clusters
    • fields

      public final Map<String,JsonData> fields()
      API name: fields
    • maxScore

      @Nullable public final Double maxScore()
      API name: max_score
    • numReducePhases

      @Nullable public final Long numReducePhases()
      API name: num_reduce_phases
    • profile

      @Nullable public final Profile profile()
      API name: profile
    • pitId

      @Nullable public final String pitId()
      API name: pit_id
    • scrollId

      @Nullable public final String scrollId()
      The identifier for the search and its search context. You can use this scroll ID with the scroll API to retrieve the next batch of search results for the request. This property is returned only if the scroll query parameter is specified in the request.

      API name: _scroll_id

    • suggest

      public final Map<String,List<Suggestion<TDocument>>> suggest()
      API name: suggest
    • terminatedEarly

      @Nullable public final Boolean terminatedEarly()
      API name: terminated_early
    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setupResponseBodyDeserializer

      protected static <TDocument, BuilderT extends ResponseBody.AbstractBuilder<TDocument, BuilderT>> void setupResponseBodyDeserializer(ObjectDeserializer<BuilderT> op, JsonpDeserializer<TDocument> tDocumentDeserializer)