Class SearchShardsDescriptor<TDocument>
A descriptor which describes a search operation for _search_shards
Inheritance
SearchShardsDescriptor<TDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class SearchShardsDescriptor<TDocument> : RequestDescriptorBase<SearchShardsDescriptor<TDocument>, SearchShardsRequestParameters, ISearchShardsRequest<TDocument>>, IDescriptor, ISearchShardsRequest<TDocument>, ISearchShardsRequest, IRequest<SearchShardsRequestParameters>, IRequest where TDocument : class
Type Parameters
Name |
Description |
TDocument |
|
Constructors
|
Edit this page
View Source
SearchShardsDescriptor()
Declaration
public SearchShardsDescriptor()
|
Edit this page
View Source
SearchShardsDescriptor(Indices)
Declaration
public SearchShardsDescriptor(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 SearchShardsDescriptor<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 SearchShardsDescriptor<TDocument> AllowNoIndices(bool? allownoindices = true)
Parameters
Type |
Name |
Description |
bool? |
allownoindices |
|
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 SearchShardsDescriptor<TDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
Parameters
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 SearchShardsDescriptor<TDocument> IgnoreUnavailable(bool? ignoreunavailable = true)
Parameters
Type |
Name |
Description |
bool? |
ignoreunavailable |
|
Returns
|
Edit this page
View Source
Index(Indices)
Returns the indexes and shards that a search request would be executed against.
Declaration
public SearchShardsDescriptor<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 SearchShardsDescriptor<TDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
Local(bool?)
If true
, the request retrieves information from the local node only.
Declaration
public SearchShardsDescriptor<TDocument> Local(bool? local = true)
Parameters
Type |
Name |
Description |
bool? |
local |
|
Returns
|
Edit this page
View Source
Preference(string)
Specifies the node or shard the operation should be performed on. Random by default.
Declaration
public SearchShardsDescriptor<TDocument> Preference(string preference)
Parameters
Type |
Name |
Description |
string |
preference |
|
Returns
|
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 SearchShardsDescriptor<TDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
Implements
Extension Methods