Class CountDescriptor<TDocument>
Descriptor for Count
https://opensearch.org/docs/latest/api-reference/count/
Inheritance
CountDescriptor<TDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class CountDescriptor<TDocument> : RequestDescriptorBase<CountDescriptor<TDocument>, CountRequestParameters, ICountRequest<TDocument>>, IDescriptor, ICountRequest<TDocument>, ICountRequest, IRequest<CountRequestParameters>, IRequest where TDocument : class
Type Parameters
Name |
Description |
TDocument |
|
Constructors
|
Edit this page
View Source
CountDescriptor()
Declaration
|
Edit this page
View Source
CountDescriptor(Indices)
Declaration
public CountDescriptor(Indices index)
Parameters
Type |
Name |
Description |
Indices |
index |
Optional, accepts null
|
Properties
|
Edit this page
View Source
HttpMethod
Declaration
protected override HttpMethod HttpMethod { get; }
Property Value
Overrides
Methods
|
Edit this page
View Source
AllIndices()
A shortcut into calling Index(Indices.All)
Declaration
public CountDescriptor<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.
Declaration
public CountDescriptor<TDocument> AllowNoIndices(bool? allownoindices = true)
Parameters
Type |
Name |
Description |
bool? |
allownoindices |
|
Returns
|
Edit this page
View Source
AnalyzeWildcard(bool?)
If true
, wildcard and prefix queries are analyzed. This parameter can only be used when the q
query string parameter is specified.
Declaration
public CountDescriptor<TDocument> AnalyzeWildcard(bool? analyzewildcard = true)
Parameters
Type |
Name |
Description |
bool? |
analyzewildcard |
|
Returns
|
Edit this page
View Source
Analyzer(string)
Analyzer to use for the query string. This parameter can only be used when the q
query string parameter is specified.
Declaration
public CountDescriptor<TDocument> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
DefaultOperator(DefaultOperator?)
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 CountDescriptor<TDocument> DefaultOperator(DefaultOperator? defaultoperator)
Parameters
Returns
|
Edit this page
View Source
Df(string)
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 CountDescriptor<TDocument> Df(string df)
Parameters
Type |
Name |
Description |
string |
df |
|
Returns
|
Edit this page
View Source
ExpandWildcards(ExpandWildcards?)
Specifies the type of index that wildcard expressions can match. Supports comma-separated values.
Declaration
public CountDescriptor<TDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
Parameters
Returns
|
Edit this page
View Source
IgnoreThrottled(bool?)
If true
, concrete, expanded or aliased indexes are ignored when frozen.
Declaration
public CountDescriptor<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 CountDescriptor<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 (*
). To search all data streams and indexes, omit this parameter or use *
or _all
.
Declaration
public CountDescriptor<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 CountDescriptor<TDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
Lenient(bool?)
If true
, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
Declaration
public CountDescriptor<TDocument> Lenient(bool? lenient = true)
Parameters
Type |
Name |
Description |
bool? |
lenient |
|
Returns
|
Edit this page
View Source
MinScore(float?)
Sets the minimum _score
value that documents must have to be included in the result.
Declaration
public CountDescriptor<TDocument> MinScore(float? minscore)
Parameters
Type |
Name |
Description |
float? |
minscore |
|
Returns
|
Edit this page
View Source
Preference(string)
Specifies the node or shard the operation should be performed on. Random by default.
Declaration
public CountDescriptor<TDocument> Preference(string preference)
Parameters
Type |
Name |
Description |
string |
preference |
|
Returns
|
Edit this page
View Source
Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer>)
Declaration
public CountDescriptor<TDocument> Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer> querySelector)
Parameters
Returns
|
Edit this page
View Source
QueryOnQueryString(string)
Query in the Lucene query string syntax.
Declaration
public CountDescriptor<TDocument> QueryOnQueryString(string queryonquerystring)
Parameters
Type |
Name |
Description |
string |
queryonquerystring |
|
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 CountDescriptor<TDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
TerminateAfter(int?)
Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting.
Declaration
public CountDescriptor<TDocument> TerminateAfter(int? terminateafter)
Parameters
Type |
Name |
Description |
int? |
terminateafter |
|
Returns
Implements
Extension Methods