Class SearchTemplateDescriptor<TDocument>
Descriptor for SearchTemplate
https://opensearch.org/docs/latest/search-plugins/search-template/
Inheritance
SearchTemplateDescriptor<TDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class SearchTemplateDescriptor<TDocument> : RequestDescriptorBase<SearchTemplateDescriptor<TDocument>, SearchTemplateRequestParameters, ISearchTemplateRequest>, IDescriptor, ISearchTemplateRequest, ITypedSearchRequest, IRequest<SearchTemplateRequestParameters>, IRequest where TDocument : class
Type Parameters
Name |
Description |
TDocument |
|
Constructors
|
Edit this page
View Source
SearchTemplateDescriptor()
/{index}/_search/template
Declaration
public SearchTemplateDescriptor()
|
Edit this page
View Source
SearchTemplateDescriptor(Indices)
/{index}/_search/template
Declaration
public SearchTemplateDescriptor(Indices index)
Parameters
Type |
Name |
Description |
Indices |
index |
Optional, accepts null
|
Methods
|
Edit this page
View Source
AllIndices()
A shortcut into calling Index(Indices.All)
Declaration
public SearchTemplateDescriptor<TDocument> AllIndices()
Returns
|
Edit this page
View Source
AllowNoIndices(bool?)
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 SearchTemplateDescriptor<TDocument> AllowNoIndices(bool? allownoindices = true)
Parameters
Type |
Name |
Description |
bool? |
allownoindices |
|
Returns
|
Edit this page
View Source
CcsMinimizeRoundtrips(bool?)
If true
, network round-trips are minimized for cross-cluster search requests.
Declaration
public SearchTemplateDescriptor<TDocument> CcsMinimizeRoundtrips(bool? ccsminimizeroundtrips = true)
Parameters
Type |
Name |
Description |
bool? |
ccsminimizeroundtrips |
|
Returns
|
Edit this page
View Source
ExpandWildcards(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
. Valid values are: all
, open
, closed
, hidden
, none
.
Declaration
public SearchTemplateDescriptor<TDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
Parameters
Returns
|
Edit this page
View Source
Explain(bool?)
If true
, the response includes additional details about score computation as part of a hit.
Declaration
public SearchTemplateDescriptor<TDocument> Explain(bool? explain = true)
Parameters
Type |
Name |
Description |
bool? |
explain |
|
Returns
|
Edit this page
View Source
Id(string)
Declaration
public SearchTemplateDescriptor<TDocument> Id(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
|
Edit this page
View Source
IgnoreThrottled(bool?)
If true
, specified concrete, expanded, or aliased indexes are not included in the response when throttled.
Declaration
public SearchTemplateDescriptor<TDocument> IgnoreThrottled(bool? ignorethrottled = true)
Parameters
Type |
Name |
Description |
bool? |
ignorethrottled |
|
Returns
|
Edit this page
View Source
IgnoreUnavailable(bool?)
If false
, the request returns an error if it targets a missing or closed index.
Declaration
public SearchTemplateDescriptor<TDocument> IgnoreUnavailable(bool? ignoreunavailable = true)
Parameters
Type |
Name |
Description |
bool? |
ignoreunavailable |
|
Returns
|
Edit this page
View Source
Index(Indices)
Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (*).
Declaration
public SearchTemplateDescriptor<TDocument> Index(Indices index)
Parameters
Type |
Name |
Description |
Indices |
index |
|
Returns
|
Edit this page
View Source
Index<TOther>()
a shortcut into calling Index(typeof(TOther))
Declaration
public SearchTemplateDescriptor<TDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
Params(Dictionary<string, object>)
Declaration
public SearchTemplateDescriptor<TDocument> Params(Dictionary<string, object> paramDictionary)
Parameters
Returns
|
Edit this page
View Source
Params(Func<FluentDictionary<string, object>, FluentDictionary<string, object>>)
Declaration
public SearchTemplateDescriptor<TDocument> Params(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> paramDictionary)
Parameters
Returns
|
Edit this page
View Source
Preference(string)
Specifies the node or shard the operation should be performed on. Random by default.
Declaration
public SearchTemplateDescriptor<TDocument> Preference(string preference)
Parameters
Type |
Name |
Description |
string |
preference |
|
Returns
|
Edit this page
View Source
Profile(bool?)
If true
, the query execution is profiled.
Declaration
public SearchTemplateDescriptor<TDocument> Profile(bool? profile = true)
Parameters
Type |
Name |
Description |
bool? |
profile |
|
Returns
|
Edit this page
View Source
RequestDefaults(SearchTemplateRequestParameters)
Allows a request implementation to set certain request parameter defaults, use sparingly!
Declaration
protected override sealed void RequestDefaults(SearchTemplateRequestParameters parameters)
Parameters
Overrides
|
Edit this page
View Source
Routing(Routing)
A document is routed to a particular shard in an index using the following formula
shard_num = hash(_routing) % num_primary_shards
OpenSearch will use the document id if not provided.
For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
if that document has a JoinField or a routing mapping on for its type exists on ConnectionSettings
Declaration
public SearchTemplateDescriptor<TDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
Specifies how long a consistent view of the index should be maintained for scrolled search.
Declaration
public SearchTemplateDescriptor<TDocument> Scroll(Time scroll)
Parameters
Type |
Name |
Description |
Time |
scroll |
|
Returns
|
Edit this page
View Source
SearchType(SearchType?)
The type of the search operation.
Declaration
public SearchTemplateDescriptor<TDocument> SearchType(SearchType? searchtype)
Parameters
Returns
|
Edit this page
View Source
Source(string)
Declaration
public SearchTemplateDescriptor<TDocument> Source(string template)
Parameters
Type |
Name |
Description |
string |
template |
|
Returns
|
Edit this page
View Source
TotalHitsAsInteger(bool?)
If true
, hits.total
are rendered as an integer in the response.
Declaration
public SearchTemplateDescriptor<TDocument> TotalHitsAsInteger(bool? totalhitsasinteger = true)
Parameters
Type |
Name |
Description |
bool? |
totalhitsasinteger |
|
Returns
|
Edit this page
View Source
TypedKeys(bool?)
If true
, the response prefixes aggregation and suggester names with their respective types.
Declaration
public SearchTemplateDescriptor<TDocument> TypedKeys(bool? typedkeys = true)
Parameters
Type |
Name |
Description |
bool? |
typedkeys |
|
Returns
Implements
Extension Methods