Class SearchDescriptor<TInferDocument>
A descriptor which describes a search operation for _search and _msearch
Inheritance
SearchDescriptor<TInferDocument>
Assembly: OpenSearch.Client.dll
Syntax
[DataContract]
public class SearchDescriptor<TInferDocument> : RequestDescriptorBase<SearchDescriptor<TInferDocument>, SearchRequestParameters, ISearchRequest<TInferDocument>>, IDescriptor, ISearchRequest<TInferDocument>, ISearchRequest, ITypedSearchRequest, IRequest<SearchRequestParameters>, IRequest where TInferDocument : class
Type Parameters
Name |
Description |
TInferDocument |
|
Constructors
|
Edit this page
View Source
SearchDescriptor()
Declaration
public SearchDescriptor()
|
Edit this page
View Source
SearchDescriptor(Indices)
Declaration
public SearchDescriptor(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
Aggregations(AggregationDictionary)
Specifies the aggregations to perform
Declaration
public SearchDescriptor<TInferDocument> Aggregations(AggregationDictionary aggregations)
Parameters
Returns
|
Edit this page
View Source
Aggregations(Func<AggregationContainerDescriptor<TInferDocument>, IAggregationContainer>)
Specifies the aggregations to perform
Declaration
public SearchDescriptor<TInferDocument> Aggregations(Func<AggregationContainerDescriptor<TInferDocument>, IAggregationContainer> aggregationsSelector)
Parameters
Returns
|
Edit this page
View Source
AllIndices()
A shortcut into calling Index(Indices.All)
Declaration
public SearchDescriptor<TInferDocument> 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 SearchDescriptor<TInferDocument> AllowNoIndices(bool? allownoindices = true)
Parameters
Type |
Name |
Description |
bool? |
allownoindices |
|
Returns
|
Edit this page
View Source
AllowPartialSearchResults(bool?)
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 SearchDescriptor<TInferDocument> AllowPartialSearchResults(bool? allowpartialsearchresults = true)
Parameters
Type |
Name |
Description |
bool? |
allowpartialsearchresults |
|
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 SearchDescriptor<TInferDocument> 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 SearchDescriptor<TInferDocument> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
BatchedReduceSize(long?)
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 SearchDescriptor<TInferDocument> BatchedReduceSize(long? batchedreducesize)
Parameters
Type |
Name |
Description |
long? |
batchedreducesize |
|
Returns
|
Edit this page
View Source
CancelAfterTimeInterval(Time)
The time after which the search request will be canceled. Request-level parameter takes precedence over cancel_after_time_interval
cluster setting.
Declaration
public SearchDescriptor<TInferDocument> CancelAfterTimeInterval(Time cancelaftertimeinterval)
Parameters
Type |
Name |
Description |
Time |
cancelaftertimeinterval |
|
Returns
|
Edit this page
View Source
CcsMinimizeRoundtrips(bool?)
If true
, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests.
Declaration
public SearchDescriptor<TInferDocument> CcsMinimizeRoundtrips(bool? ccsminimizeroundtrips = true)
Parameters
Type |
Name |
Description |
bool? |
ccsminimizeroundtrips |
|
Returns
|
Edit this page
View Source
Collapse(Func<FieldCollapseDescriptor<TInferDocument>, IFieldCollapse>)
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
public SearchDescriptor<TInferDocument> Collapse(Func<FieldCollapseDescriptor<TInferDocument>, IFieldCollapse> collapseSelector)
Parameters
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 SearchDescriptor<TInferDocument> 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 SearchDescriptor<TInferDocument> Df(string df)
Parameters
Type |
Name |
Description |
string |
df |
|
Returns
|
Edit this page
View Source
DocValueFields(Fields)
Declaration
public SearchDescriptor<TInferDocument> DocValueFields(Fields fields)
Parameters
Type |
Name |
Description |
Fields |
fields |
|
Returns
|
Edit this page
View Source
DocValueFields(Func<FieldsDescriptor<TInferDocument>, IPromise<Fields>>)
Allows to return a script evaluation (based on different fields) for each hit
Declaration
public SearchDescriptor<TInferDocument> DocValueFields(Func<FieldsDescriptor<TInferDocument>, IPromise<Fields>> fields)
Parameters
Returns
|
Edit this page
View Source
ExecuteOnLocalShard()
Controls a preference of which shard replicas to execute the search request on.
By default, the operation is randomized between the each shard replicas.
The operation will prefer to be executed on a local allocated shard is possible.
Declaration
public SearchDescriptor<TInferDocument> ExecuteOnLocalShard()
Returns
|
Edit this page
View Source
ExecuteOnNode(string)
Controls a preference of which shard replicas to execute the search request on.
By default, the operation is randomized between the each shard replicas.
Restricts the search to execute only on a node with the provided node id
Declaration
public SearchDescriptor<TInferDocument> ExecuteOnNode(string node)
Parameters
Type |
Name |
Description |
string |
node |
|
Returns
|
Edit this page
View Source
ExecuteOnPreferredNode(string)
Controls a preference of which shard replicas to execute the search request on.
By default, the operation is randomized between the each shard replicas.
Prefers execution on the node with the provided node id if applicable.
Declaration
public SearchDescriptor<TInferDocument> ExecuteOnPreferredNode(string node)
Parameters
Type |
Name |
Description |
string |
node |
|
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
.
Declaration
public SearchDescriptor<TInferDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
Parameters
Returns
|
Edit this page
View Source
Explain(bool?)
Enables explanation for each hit on how its score was computed
Declaration
public SearchDescriptor<TInferDocument> Explain(bool? explain = true)
Parameters
Type |
Name |
Description |
bool? |
explain |
|
Returns
|
Edit this page
View Source
Ext(IDictionary<string, object>)
Declaration
public SearchDescriptor<TInferDocument> Ext(IDictionary<string, object> dictionary)
Parameters
Returns
|
Edit this page
View Source
Ext(Func<FluentDictionary<string, object>, FluentDictionary<string, object>>)
Declaration
public SearchDescriptor<TInferDocument> Ext(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> selector)
Parameters
Returns
|
Edit this page
View Source
Fields(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
public SearchDescriptor<TInferDocument> Fields(Fields fields)
Parameters
Type |
Name |
Description |
Fields |
fields |
|
Returns
|
Edit this page
View Source
Fields(Func<FieldsDescriptor<TInferDocument>, IPromise<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
public SearchDescriptor<TInferDocument> Fields(Func<FieldsDescriptor<TInferDocument>, IPromise<Fields>> fields)
Parameters
Returns
|
Edit this page
View Source
Fields<TSource>(Func<FieldsDescriptor<TSource>, IPromise<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
public SearchDescriptor<TInferDocument> Fields<TSource>(Func<FieldsDescriptor<TSource>, IPromise<Fields>> fields) where TSource : class
Parameters
Returns
Type Parameters
|
Edit this page
View Source
From(int?)
The starting from index of the hits to return. Defaults to 0.
Declaration
public SearchDescriptor<TInferDocument> From(int? from)
Parameters
Type |
Name |
Description |
int? |
from |
|
Returns
|
Edit this page
View Source
Highlight(Func<HighlightDescriptor<TInferDocument>, IHighlight>)
Allow to highlight search results on one or more fields. The implementation uses the either lucene
fast-vector-highlighter or highlighter.
Declaration
public SearchDescriptor<TInferDocument> Highlight(Func<HighlightDescriptor<TInferDocument>, IHighlight> highlightSelector)
Parameters
Returns
|
Edit this page
View Source
IgnoreThrottled(bool?)
If true
, concrete, expanded or aliased indexes will be ignored when frozen.
Declaration
public SearchDescriptor<TInferDocument> 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 SearchDescriptor<TInferDocument> IgnoreUnavailable(bool? ignoreunavailable = true)
Parameters
Type |
Name |
Description |
bool? |
ignoreunavailable |
|
Returns
|
Edit this page
View Source
IncludeNamedQueriesScore(bool?)
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 SearchDescriptor<TInferDocument> IncludeNamedQueriesScore(bool? includenamedqueriesscore = true)
Parameters
Type |
Name |
Description |
bool? |
includenamedqueriesscore |
|
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 SearchDescriptor<TInferDocument> 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 SearchDescriptor<TInferDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
IndicesBoost(Func<FluentDictionary<IndexName, double>, FluentDictionary<IndexName, double>>)
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
public SearchDescriptor<TInferDocument> IndicesBoost(Func<FluentDictionary<IndexName, double>, FluentDictionary<IndexName, double>> boost)
Parameters
Returns
|
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. This parameter can only be used when the q
query string parameter is specified.
Declaration
public SearchDescriptor<TInferDocument> Lenient(bool? lenient = true)
Parameters
Type |
Name |
Description |
bool? |
lenient |
|
Returns
|
Edit this page
View Source
MatchAll(Func<MatchAllQueryDescriptor, IMatchAllQuery>)
Shortcut to default to a match all query
Declaration
public SearchDescriptor<TInferDocument> MatchAll(Func<MatchAllQueryDescriptor, IMatchAllQuery> selector = null)
Parameters
Returns
|
Edit this page
View Source
MaxConcurrentShardRequests(long?)
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 SearchDescriptor<TInferDocument> MaxConcurrentShardRequests(long? maxconcurrentshardrequests)
Parameters
Type |
Name |
Description |
long? |
maxconcurrentshardrequests |
|
Returns
|
Edit this page
View Source
MinScore(double?)
Allows to filter out documents based on a minimum score
Declaration
public SearchDescriptor<TInferDocument> MinScore(double? minScore)
Parameters
Type |
Name |
Description |
double? |
minScore |
|
Returns
|
Edit this page
View Source
PhaseTook(bool?)
Indicates whether to return phase-level took
time values in the response.
Declaration
public SearchDescriptor<TInferDocument> PhaseTook(bool? phasetook = true)
Parameters
Type |
Name |
Description |
bool? |
phasetook |
|
Returns
|
Edit this page
View Source
PointInTime(Func<PointInTimeDescriptor, IPointInTime>)
Declaration
public SearchDescriptor<TInferDocument> PointInTime(Func<PointInTimeDescriptor, IPointInTime> selector)
Parameters
Returns
See Also
|
Edit this page
View Source
PostFilter(Func<QueryContainerDescriptor<TInferDocument>, QueryContainer>)
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
public SearchDescriptor<TInferDocument> PostFilter(Func<QueryContainerDescriptor<TInferDocument>, QueryContainer> filter)
Parameters
Returns
|
Edit this page
View Source
PreFilterShardSize(long?)
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 SearchDescriptor<TInferDocument> PreFilterShardSize(long? prefiltershardsize)
Parameters
Type |
Name |
Description |
long? |
prefiltershardsize |
|
Returns
|
Edit this page
View Source
Preference(string)
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 SearchDescriptor<TInferDocument> Preference(string preference)
Parameters
Type |
Name |
Description |
string |
preference |
|
Returns
|
Edit this page
View Source
Profile(bool?)
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
public SearchDescriptor<TInferDocument> Profile(bool? profile = true)
Parameters
Type |
Name |
Description |
bool? |
profile |
|
Returns
|
Edit this page
View Source
Query(Func<QueryContainerDescriptor<TInferDocument>, QueryContainer>)
Specify the search query to perform
Declaration
public SearchDescriptor<TInferDocument> Query(Func<QueryContainerDescriptor<TInferDocument>, QueryContainer> query)
Parameters
Returns
|
Edit this page
View Source
QueryOnQueryString(string)
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 SearchDescriptor<TInferDocument> QueryOnQueryString(string queryonquerystring)
Parameters
Type |
Name |
Description |
string |
queryonquerystring |
|
Returns
|
Edit this page
View Source
RequestCache(bool?)
If true
, the caching of search results is enabled for requests where size
is 0
. Defaults to index level settings.
Declaration
public SearchDescriptor<TInferDocument> RequestCache(bool? requestcache = true)
Parameters
Type |
Name |
Description |
bool? |
requestcache |
|
Returns
|
Edit this page
View Source
RequestDefaults(SearchRequestParameters)
Allows a request implementation to set certain request parameter defaults, use sparingly!
Declaration
protected override sealed void RequestDefaults(SearchRequestParameters parameters)
Parameters
Overrides
|
Edit this page
View Source
Rescore(Func<RescoringDescriptor<TInferDocument>, IPromise<IList<IRescore>>>)
Specify one or more queries to use for rescoring
Declaration
public SearchDescriptor<TInferDocument> Rescore(Func<RescoringDescriptor<TInferDocument>, IPromise<IList<IRescore>>> rescoreSelector)
Parameters
Returns
|
Edit this page
View Source
ResolveUrl(RouteValues, IConnectionSettingsValues)
Declaration
protected override string ResolveUrl(RouteValues routeValues, IConnectionSettingsValues settings)
Parameters
Returns
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 SearchDescriptor<TInferDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
RuntimeFields(Func<RuntimeFieldsDescriptor<TInferDocument>, IPromise<IRuntimeFields>>)
Specifies runtime fields which exist only as part of the query.
Declaration
public SearchDescriptor<TInferDocument> RuntimeFields(Func<RuntimeFieldsDescriptor<TInferDocument>, IPromise<IRuntimeFields>> runtimeFieldsSelector)
Parameters
Returns
|
Edit this page
View Source
RuntimeFields<TSource>(Func<RuntimeFieldsDescriptor<TSource>, IPromise<IRuntimeFields>>)
Specifies runtime fields which exist only as part of the query.
Declaration
public SearchDescriptor<TInferDocument> RuntimeFields<TSource>(Func<RuntimeFieldsDescriptor<TSource>, IPromise<IRuntimeFields>> runtimeFieldsSelector) where TSource : class
Parameters
Returns
Type Parameters
|
Edit this page
View Source
ScriptFields(Func<ScriptFieldsDescriptor, IPromise<IScriptFields>>)
Allows to return a script evaluation (based on different fields) for each hit
Declaration
public SearchDescriptor<TInferDocument> ScriptFields(Func<ScriptFieldsDescriptor, IPromise<IScriptFields>> selector)
Parameters
Returns
|
Edit this page
View Source
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 SearchDescriptor<TInferDocument> Scroll(Time scroll)
Parameters
Type |
Name |
Description |
Time |
scroll |
|
Returns
|
Edit this page
View Source
SearchAfter(IEnumerable<object>)
Sort values that can be used to start returning results "after" any document in the result list.
Declaration
public SearchDescriptor<TInferDocument> SearchAfter(IEnumerable<object> searchAfter)
Parameters
Returns
|
Edit this page
View Source
SearchAfter(IList<object>)
Sort values that can be used to start returning results "after" any document in the result list.
Declaration
public SearchDescriptor<TInferDocument> SearchAfter(IList<object> searchAfter)
Parameters
Returns
|
Edit this page
View Source
SearchAfter(params object[])
Sort values that can be used to start returning results "after" any document in the result list.
Declaration
public SearchDescriptor<TInferDocument> SearchAfter(params object[] searchAfter)
Parameters
Type |
Name |
Description |
object[] |
searchAfter |
|
Returns
|
Edit this page
View Source
SearchPipeline(string)
Customizable sequence of processing stages applied to search queries.
Declaration
public SearchDescriptor<TInferDocument> SearchPipeline(string searchpipeline)
Parameters
Type |
Name |
Description |
string |
searchpipeline |
|
Returns
|
Edit this page
View Source
SearchType(SearchType?)
How distributed term frequencies are calculated for relevance scoring.
Declaration
public SearchDescriptor<TInferDocument> SearchType(SearchType? searchtype)
Parameters
Returns
|
Edit this page
View Source
SequenceNumberPrimaryTerm(bool?)
If true
, returns sequence number and primary term of the last modification of each hit.
Declaration
public SearchDescriptor<TInferDocument> SequenceNumberPrimaryTerm(bool? sequencenumberprimaryterm = true)
Parameters
Type |
Name |
Description |
bool? |
sequencenumberprimaryterm |
|
Returns
|
Edit this page
View Source
Size(int?)
The number of hits to return. Defaults to 10.
Declaration
public SearchDescriptor<TInferDocument> Size(int? size)
Parameters
Type |
Name |
Description |
int? |
size |
|
Returns
|
Edit this page
View Source
Skip(int?)
The starting from index of the hits to return. Defaults to 0.
Declaration
public SearchDescriptor<TInferDocument> Skip(int? skip)
Parameters
Type |
Name |
Description |
int? |
skip |
|
Returns
|
Edit this page
View Source
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
public SearchDescriptor<TInferDocument> Slice(Func<SlicedScrollDescriptor<TInferDocument>, ISlicedScroll> selector)
Parameters
Returns
|
Edit this page
View Source
Sort(Func<SortDescriptor<TInferDocument>, IPromise<IList<ISort>>>)
Specifies how to sort the search hits
Declaration
public SearchDescriptor<TInferDocument> Sort(Func<SortDescriptor<TInferDocument>, IPromise<IList<ISort>>> selector)
Parameters
Returns
|
Edit this page
View Source
Source(bool)
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
public SearchDescriptor<TInferDocument> Source(bool enabled = true)
Parameters
Type |
Name |
Description |
bool |
enabled |
|
Returns
|
Edit this page
View Source
Source(Func<SourceFilterDescriptor<TInferDocument>, ISourceFilter>)
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
public SearchDescriptor<TInferDocument> Source(Func<SourceFilterDescriptor<TInferDocument>, ISourceFilter> selector)
Parameters
Returns
|
Edit this page
View Source
Stats(params string[])
Specific tag
of the request for logging and statistical purposes.
Declaration
public SearchDescriptor<TInferDocument> Stats(params string[] stats)
Parameters
Type |
Name |
Description |
string[] |
stats |
|
Returns
|
Edit this page
View Source
StoredFields(Fields)
Declaration
public SearchDescriptor<TInferDocument> StoredFields(Fields fields)
Parameters
Type |
Name |
Description |
Fields |
fields |
|
Returns
|
Edit this page
View Source
StoredFields(Func<FieldsDescriptor<TInferDocument>, IPromise<Fields>>)
Declaration
public SearchDescriptor<TInferDocument> StoredFields(Func<FieldsDescriptor<TInferDocument>, IPromise<Fields>> fields)
Parameters
Returns
|
Edit this page
View Source
Suggest(Func<SuggestContainerDescriptor<TInferDocument>, IPromise<ISuggestContainer>>)
The suggest feature suggests similar looking terms based on a provided text by using a suggester
Declaration
public SearchDescriptor<TInferDocument> Suggest(Func<SuggestContainerDescriptor<TInferDocument>, IPromise<ISuggestContainer>> selector)
Parameters
Returns
|
Edit this page
View Source
SuggestField(Field)
Specifies which field to use for suggestions.
Declaration
public SearchDescriptor<TInferDocument> SuggestField(Field suggestfield)
Parameters
Type |
Name |
Description |
Field |
suggestfield |
|
Returns
|
Edit this page
View Source
SuggestField(Expression<Func<TInferDocument, object>>)
Specifies which field to use for suggestions.
Declaration
public SearchDescriptor<TInferDocument> SuggestField(Expression<Func<TInferDocument, object>> field)
Parameters
Returns
|
Edit this page
View Source
SuggestMode(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 SearchDescriptor<TInferDocument> SuggestMode(SuggestMode? suggestmode)
Parameters
Returns
|
Edit this page
View Source
SuggestSize(long?)
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 SearchDescriptor<TInferDocument> SuggestSize(long? suggestsize)
Parameters
Type |
Name |
Description |
long? |
suggestsize |
|
Returns
|
Edit this page
View Source
SuggestText(string)
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 SearchDescriptor<TInferDocument> SuggestText(string suggesttext)
Parameters
Type |
Name |
Description |
string |
suggesttext |
|
Returns
|
Edit this page
View Source
Take(int?)
The number of hits to return. Defaults to 10.
Declaration
public SearchDescriptor<TInferDocument> Take(int? take)
Parameters
Type |
Name |
Description |
int? |
take |
|
Returns
|
Edit this page
View Source
TerminateAfter(long?)
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
public SearchDescriptor<TInferDocument> TerminateAfter(long? terminateAfter)
Parameters
Type |
Name |
Description |
long? |
terminateAfter |
|
Returns
|
Edit this page
View Source
Timeout(string)
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
public SearchDescriptor<TInferDocument> Timeout(string timeout)
Parameters
Type |
Name |
Description |
string |
timeout |
|
Returns
|
Edit this page
View Source
TotalHitsAsInteger(bool?)
Indicates whether hits.total
should be rendered as an integer or an object in the rest search response.
Declaration
public SearchDescriptor<TInferDocument> TotalHitsAsInteger(bool? totalhitsasinteger = true)
Parameters
Type |
Name |
Description |
bool? |
totalhitsasinteger |
|
Returns
|
Edit this page
View Source
TrackScores(bool?)
Make sure we keep calculating score even if we are sorting on a field.
Declaration
public SearchDescriptor<TInferDocument> TrackScores(bool? trackscores = true)
Parameters
Type |
Name |
Description |
bool? |
trackscores |
|
Returns
|
Edit this page
View Source
TrackTotalHits()
Declaration
public SearchDescriptor<TInferDocument> TrackTotalHits()
Returns
|
Edit this page
View Source
TrackTotalHits(TrackTotalHits)
Declaration
public SearchDescriptor<TInferDocument> TrackTotalHits(TrackTotalHits trackTotalHits)
Parameters
Returns
|
Edit this page
View Source
TypedKeys(bool?)
If true
, aggregation and suggester names are be prefixed by their respective types in the response.
Declaration
public SearchDescriptor<TInferDocument> TypedKeys(bool? typedkeys = true)
Parameters
Type |
Name |
Description |
bool? |
typedkeys |
|
Returns
|
Edit this page
View Source
Version(bool?)
Return a version for each search hit
Declaration
public SearchDescriptor<TInferDocument> Version(bool? version = true)
Parameters
Type |
Name |
Description |
bool? |
version |
|
Returns
Implements
Extension Methods