Class SearchResponse<TDocument>
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public class SearchResponse<TDocument> : ResponseBase, ISearchResponse<TDocument>, IResponse, IOpenSearchResponse where TDocument : class
Type Parameters
| Name | Description |
|---|---|
| TDocument |
Properties
| Edit this page View SourceAggregations
Gets the collection of aggregations
Declaration
[DataMember(Name = "aggregations")]
public AggregateDictionary Aggregations { get; }
Property Value
| Type | Description |
|---|---|
| AggregateDictionary |
Clusters
Gets the statistics about the clusters on which the search query was executed.
Declaration
[DataMember(Name = "_clusters")]
public ClusterStatistics Clusters { get; }
Property Value
| Type | Description |
|---|---|
| ClusterStatistics |
Documents
Gets the documents inside the hits, by deserializing Source
into TDocument
NOTE: if you use StoredFields on the search request, Documents will be empty and you should use Fields instead to get the field values. As an alternative to Fields, try source filtering using Source on the search request to return Documents with partial fields selected
Declaration
[IgnoreDataMember]
public IReadOnlyCollection<TDocument> Documents { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<TDocument> |
Fields
Gets the field values inside the hits, when the search request uses StoredFields.
Declaration
[IgnoreDataMember]
public IReadOnlyCollection<FieldValues> Fields { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<FieldValues> |
Hits
Gets the collection of hits that matched the query
Declaration
[IgnoreDataMember]
public IReadOnlyCollection<IHit<TDocument>> Hits { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<IHit<TDocument>> | The hits. |
HitsMetadata
Gets the meta data about the hits that match the search query criteria.
Declaration
[DataMember(Name = "hits")]
public IHitsMetadata<TDocument> HitsMetadata { get; }
Property Value
| Type | Description |
|---|---|
| IHitsMetadata<TDocument> |
MaxScore
Gets the maximum score for documents matching the search query criteria
Declaration
[IgnoreDataMember]
public double MaxScore { get; }
Property Value
| Type | Description |
|---|---|
| double |
NumberOfReducePhases
Number of times the server performed an incremental reduce phase
Declaration
[DataMember(Name = "num_reduce_phases")]
public long NumberOfReducePhases { get; }
Property Value
| Type | Description |
|---|---|
| long |
Profile
Gets the results of profiling the search query. Has a value only when
Profile is set to true on the search request.
Declaration
[DataMember(Name = "profile")]
public Profile Profile { get; }
Property Value
| Type | Description |
|---|---|
| Profile |
ScrollId
Gets the scroll id which can be passed to the Scroll API in order to retrieve the next batch of results. Has a value only when Scroll is specified on the search request
Declaration
[DataMember(Name = "_scroll_id")]
public string ScrollId { get; }
Property Value
| Type | Description |
|---|---|
| string |
Shards
Gets the statistics about the shards on which the search query was executed.
Declaration
[DataMember(Name = "_shards")]
public ShardStatistics Shards { get; }
Property Value
| Type | Description |
|---|---|
| ShardStatistics |
Suggest
Gets the suggester results.
Declaration
[DataMember(Name = "suggest")]
public ISuggestDictionary<TDocument> Suggest { get; }
Property Value
| Type | Description |
|---|---|
| ISuggestDictionary<TDocument> |
TerminatedEarly
Gets a value indicating whether the search was terminated early
Declaration
[DataMember(Name = "terminated_early")]
public bool TerminatedEarly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
TimedOut
Gets a value indicating whether the search timed out or not
Declaration
[DataMember(Name = "timed_out")]
public bool TimedOut { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Took
Time in milliseconds for OpenSearch to execute the search
Declaration
[DataMember(Name = "took")]
public long Took { get; }
Property Value
| Type | Description |
|---|---|
| long |
Total
Gets the total number of documents matching the search query criteria
Declaration
[IgnoreDataMember]
public long Total { get; }
Property Value
| Type | Description |
|---|---|
| long |