Class SearchResult<TDocument>

java.lang.Object
org.opensearch.client.opensearch.core.search.SearchResult<TDocument>
All Implemented Interfaces:
JsonpSerializable, PlainJsonSerializable
Direct Known Subclasses:
SearchResponse, SearchTemplateResponse

public abstract class SearchResult<TDocument> extends Object implements PlainJsonSerializable
  • Constructor Details

  • Method Details

    • took

      public final long took()
      Required - API name: took
    • timedOut

      public final boolean timedOut()
      Required - API name: timed_out
    • shards

      public final ShardStatistics shards()
      Required - API name: _shards
    • hits

      public final HitsMetadata<TDocument> hits()
      Required - API name: hits
    • aggregations

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

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

      public final List<TDocument> documents()
      API name: documents
    • 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()
      API name: _scroll_id
    • suggest

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

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

      @Nullable public final PhaseTook phaseTook()
      API name: phase_took
    • 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)
    • setupSearchResultDeserializer

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