Class SearchRequestParameters
Request options for Search
https://opensearch.org/docs/latest/api-reference/search/
Implements
Inherited Members
Namespace: OpenSearch.Net
Assembly: OpenSearch.Net.dll
Syntax
public class SearchRequestParameters : RequestParameters<SearchRequestParameters>, IRequestParameters
Properties
| Edit this page View SourceAllowNoIndices
If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed
indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting foo*,bar* returns
an error if an index starts with foo but no index starts with bar.
Declaration
public bool? AllowNoIndices { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
AllowPartialSearchResults
If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no
partial results.
Declaration
public bool? AllowPartialSearchResults { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
AnalyzeWildcard
If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.
Declaration
public bool? AnalyzeWildcard { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Analyzer
Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.
Declaration
public string Analyzer { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
BatchedReduceSize
The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
Declaration
public int? BatchedReduceSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
CancelAfterTimeInterval
The time after which the search request will be canceled. Request-level parameter takes precedence over cancel_after_time_interval
cluster setting.
Declaration
public TimeSpan CancelAfterTimeInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
CcsMinimizeRoundtrips
If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster
search (CCS) requests.
Declaration
public bool? CcsMinimizeRoundtrips { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
DefaultHttpMethod
Declaration
public override HttpMethod DefaultHttpMethod { get; }
Property Value
| Type | Description |
|---|---|
| HttpMethod |
Overrides
| Edit this page View SourceDefaultOperator
The default operator for query string query: AND or OR. This parameter can only be used when the q query string parameter is
specified.
Declaration
public DefaultOperator? DefaultOperator { get; set; }
Property Value
| Type | Description |
|---|---|
| DefaultOperator? |
Df
Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.
Declaration
public string Df { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DocValueFields
A comma-separated list of fields to return as the docvalue representation for each hit.
Declaration
public string[] DocValueFields { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
ExpandWildcards
Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard
expressions match hidden data streams. Supports comma-separated values, such as open,hidden.
Declaration
public ExpandWildcards? ExpandWildcards { get; set; }
Property Value
| Type | Description |
|---|---|
| ExpandWildcards? |
IgnoreThrottled
If true, concrete, expanded or aliased indexes will be ignored when frozen.
Declaration
public bool? IgnoreThrottled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
IgnoreUnavailable
If false, the request returns an error if it targets a missing or closed index.
Declaration
public bool? IgnoreUnavailable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
IncludeNamedQueriesScore
Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its
score (true) or as an array containing the name of the matched queries (false).
Declaration
public bool? IncludeNamedQueriesScore { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Lenient
If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This
parameter can only be used when the q query string parameter is specified.
Declaration
public bool? Lenient { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
MaxConcurrentShardRequests
Defines the number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.
Declaration
public int? MaxConcurrentShardRequests { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
PhaseTook
Indicates whether to return phase-level took time values in the response.
Declaration
public bool? PhaseTook { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
PreFilterShardSize
Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.
Declaration
public int? PreFilterShardSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Preference
Nodes and shards used for the search. By default, OpenSearch selects from eligible nodes and shards using adaptive replica selection,
accounting for allocation awareness. Valid values are: _only_local to run the search only on shards on the local node;
_local to, if possible, run the search on shards on the local node, or if not, select shards using the default method;
_only_nodes:<node-id>,<node-id> to run the search on only the specified nodes IDs, where, if suitable shards exist on
more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select
shards from any available node using the default method; _prefer_nodes:<node-id>,<node-id> to if possible, run the
search on the specified nodes IDs, or if not, select shards using the default method; shards:<shard>,<shard> to run
the search only on the specified shards; <custom-string> (any string that does not start with ) to route searches
with the same <custom-string> to the same shards in the same order.
Declaration
public string Preference { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
QueryOnQueryString
Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full OpenSearch Query DSL but are handy for testing.
Declaration
public string QueryOnQueryString { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
RequestCache
If true, the caching of search results is enabled for requests where size is 0. Defaults to index level settings.
Declaration
public bool? RequestCache { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Routing
A custom value used to route operations to a specific shard.
Declaration
public string[] Routing { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
Scroll
Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed 1d (24 hours).
You can change this limit using the search.max_keep_alive cluster-level setting.
Declaration
public TimeSpan Scroll { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
SearchPipeline
Customizable sequence of processing stages applied to search queries.
Declaration
public string SearchPipeline { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SearchType
How distributed term frequencies are calculated for relevance scoring.
Declaration
public SearchType? SearchType { get; set; }
Property Value
| Type | Description |
|---|---|
| SearchType? |
SequenceNumberPrimaryTerm
If true, returns sequence number and primary term of the last modification of each hit.
Declaration
public bool? SequenceNumberPrimaryTerm { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Stats
Specific tag of the request for logging and statistical purposes.
Declaration
public string[] Stats { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
StoredFields
A comma-separated list of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the
response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return
both source fields and stored fields in the search response.
Declaration
public string[] StoredFields { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
SuggestField
Specifies which field to use for suggestions.
Declaration
public string SuggestField { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SuggestMode
Specifies the suggest mode. This parameter can only be used when the suggest_field and suggest_text query string parameters
are specified.
Declaration
public SuggestMode? SuggestMode { get; set; }
Property Value
| Type | Description |
|---|---|
| SuggestMode? |
SuggestSize
Number of suggestions to return. This parameter can only be used when the suggest_field and suggest_text query string
parameters are specified.
Declaration
public int? SuggestSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
SuggestText
The source text for which the suggestions should be returned. This parameter can only be used when the suggest_field and
suggest_text query string parameters are specified.
Declaration
public string SuggestText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SupportsBody
Declaration
public override bool SupportsBody { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
| Edit this page View SourceTotalHitsAsInteger
Indicates whether hits.total should be rendered as an integer or an object in the rest search response.
Declaration
public bool? TotalHitsAsInteger { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
TypedKeys
If true, aggregation and suggester names are be prefixed by their respective types in the response.
Declaration
public bool? TypedKeys { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
VerbosePipeline
Enables or disables verbose mode for the search pipeline. When verbose mode is enabled, detailed information about each processor in the search pipeline is included in the search response. This includes the processor name, execution status, input, output, and time taken for processing. This parameter is primarily intended for debugging purposes, allowing users to track how data flows and transforms through the search pipeline.
Declaration
public bool? VerbosePipeline { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Remarks
Supported by OpenSearch servers of version 3.0.0 or greater.