Interface ISearchRequest
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public interface ISearchRequest : ITypedSearchRequest, IRequest<SearchRequestParameters>, IRequest
Properties
| Edit this page View SourceAggregations
Specifies the aggregations to perform
Declaration
[DataMember(Name = "aggs")]
AggregationDictionary Aggregations { get; set; }
Property Value
Type | Description |
---|---|
AggregationDictionary |
Collapse
Allows to collapse search results based on field values. The collapsing is done by selecting only the top sorted document per collapse key. For instance the query below retrieves the best tweet for each user and sorts them by number of likes.
NOTE: The collapsing is applied to the top hits only and does not affect aggregations. You can only collapse to a depth of 2.
Declaration
[DataMember(Name = "collapse")]
IFieldCollapse Collapse { get; set; }
Property Value
Type | Description |
---|---|
IFieldCollapse |
DocValueFields
Declaration
[DataMember(Name = "docvalue_fields")]
Fields DocValueFields { get; set; }
Property Value
Type | Description |
---|---|
Fields |
Explain
Enables explanation for each hit on how its score was computed
Declaration
[DataMember(Name = "explain")]
bool? Explain { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Ext
Declaration
[DataMember(Name = "ext")]
IDictionary<string, object> Ext { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<string, object> |
Fields
BETA: Allows for retrieving a list of document fields in the search response.
This functionality is in beta and is subject to change.
Declaration
[DataMember(Name = "fields")]
Fields Fields { get; set; }
Property Value
Type | Description |
---|---|
Fields |
From
The starting from index of the hits to return. Defaults to 0.
Declaration
[DataMember(Name = "from")]
int? From { get; set; }
Property Value
Type | Description |
---|---|
int? |
Highlight
Allow to highlight search results on one or more fields. The implementation uses the either lucene fast-vector-highlighter or highlighter.
Declaration
[DataMember(Name = "highlight")]
IHighlight Highlight { get; set; }
Property Value
Type | Description |
---|---|
IHighlight |
Index
Declaration
[IgnoreDataMember]
Indices Index { get; }
Property Value
Type | Description |
---|---|
Indices |
IndicesBoost
Allows to configure different boost level per index when searching across more than one indices. This is very handy when hits coming from one index matter more than hits coming from another index (think social graph where each user has an index).
Declaration
[DataMember(Name = "indices_boost")]
IDictionary<IndexName, double> IndicesBoost { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<IndexName, double> |
MinScore
Allows to filter out documents based on a minimum score
Declaration
[DataMember(Name = "min_score")]
double? MinScore { get; set; }
Property Value
Type | Description |
---|---|
double? |
PointInTime
Search against a dataset frozen at a point-in-time (PIT)
https://opensearch.org/docs/latest/search-plugins/point-in-time/Declaration
[DataMember(Name = "pit")]
IPointInTime PointInTime { get; set; }
Property Value
Type | Description |
---|---|
IPointInTime |
Remarks
Supported by OpenSearch servers of version 2.4.0 or greater.
See Also
| Edit this page View SourcePostFilter
Specify a query to apply to the search hits at the very end of a search request, after aggregations have already been calculated. Useful when both search hits and aggregations will be returned in the response, and a filter should only be applied to the search hits.
Declaration
[DataMember(Name = "post_filter")]
QueryContainer PostFilter { get; set; }
Property Value
Type | Description |
---|---|
QueryContainer |
Profile
The Profile API provides detailed timing information about the execution of individual components in a query. It gives the user insight into how queries are executed at a low level so that the user can understand why certain queries are slow, and take steps to improve their slow queries.
Declaration
[DataMember(Name = "profile")]
bool? Profile { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Query
Specify the search query to perform
Declaration
[DataMember(Name = "query")]
QueryContainer Query { get; set; }
Property Value
Type | Description |
---|---|
QueryContainer |
Rescore
Specify one or more queries to use for rescoring
Declaration
[DataMember(Name = "rescore")]
IList<IRescore> Rescore { get; set; }
Property Value
Type | Description |
---|---|
IList<IRescore> |
RuntimeFields
Specifies runtime fields which exist only as part of the query.
Declaration
[DataMember(Name = "runtime_mappings")]
IRuntimeFields RuntimeFields { get; set; }
Property Value
Type | Description |
---|---|
IRuntimeFields |
ScriptFields
Allows to return a script evaluation (based on different fields) for each hit
Declaration
[DataMember(Name = "script_fields")]
IScriptFields ScriptFields { get; set; }
Property Value
Type | Description |
---|---|
IScriptFields |
SearchAfter
Sort values that can be used to start returning results "after" any document in the result list.
Declaration
[DataMember(Name = "search_after")]
IList<object> SearchAfter { get; set; }
Property Value
Type | Description |
---|---|
IList<object> |
Size
The number of hits to return. Defaults to 10.
Declaration
[DataMember(Name = "size")]
int? Size { get; set; }
Property Value
Type | Description |
---|---|
int? |
Slice
For scroll queries that return a lot of documents it is possible to split the scroll in multiple slices which can be consumed independently
Declaration
[DataMember(Name = "slice")]
ISlicedScroll Slice { get; set; }
Property Value
Type | Description |
---|---|
ISlicedScroll |
Sort
Specifies how to sort the search hits
Declaration
[DataMember(Name = "sort")]
IList<ISort> Sort { get; set; }
Property Value
Type | Description |
---|---|
IList<ISort> |
Source
Specify how the _source field is returned for each search hit.
When true
, _source retrieval is enabled (default)
When false
, _source retrieval is disabled, and no _source will be returned for each hit
When ISourceFilter is specified, fields to include/exclude can be controlled
Declaration
[DataMember(Name = "_source")]
Union<bool, ISourceFilter> Source { get; set; }
Property Value
Type | Description |
---|---|
Union<bool, ISourceFilter> |
StoredFields
Declaration
[DataMember(Name = "stored_fields")]
Fields StoredFields { get; set; }
Property Value
Type | Description |
---|---|
Fields |
Suggest
The suggest feature suggests similar looking terms based on a provided text by using a suggester
Declaration
[DataMember(Name = "suggest")]
ISuggestContainer Suggest { get; set; }
Property Value
Type | Description |
---|---|
ISuggestContainer |
TerminateAfter
The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. If set, the response will have a boolean field terminated_early to indicate whether the query execution has actually terminated_early.
Declaration
[DataMember(Name = "terminate_after")]
long? TerminateAfter { get; set; }
Property Value
Type | Description |
---|---|
long? |
Timeout
A search timeout, bounding the search request to be executed within the specified time value and bail with the hits accumulated up to that point, when expired. Defaults to no timeout.
Declaration
[DataMember(Name = "timeout")]
string Timeout { get; set; }
Property Value
Type | Description |
---|---|
string |
TrackScores
Make sure we keep calculating score even if we are sorting on a field.
Declaration
[DataMember(Name = "track_scores")]
bool? TrackScores { get; set; }
Property Value
Type | Description |
---|---|
bool? |
TrackTotalHits
Declaration
[DataMember(Name = "track_total_hits")]
TrackTotalHits TrackTotalHits { get; set; }
Property Value
Type | Description |
---|---|
TrackTotalHits |
Version
Return a version for each search hit
Declaration
[DataMember(Name = "version")]
bool? Version { get; set; }
Property Value
Type | Description |
---|---|
bool? |