NEST by Elasticsearch Inc. and contributors

<PackageReference Include="NEST" Version="1.7.1" />

.NET API 2,349,056 bytes

 SearchDescriptor<T>

descriptor for SearchGet http://www.elastic.co/guide/en/elasticsearch/reference/1.6/search-search.html

public SearchDescriptor<T> AllowNoIndices(bool allow_no_indices = true)

Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)

public SearchDescriptor<T> Analyzer(string analyzer)

The analyzer to use for the query string

public SearchDescriptor<T> AnalyzeWildcard(bool analyze_wildcard = true)

Specify whether wildcard and prefix queries should be analyzed (default: false)

public SearchDescriptor<T> ConcreteTypeSelector(Func<object, Hit<object>, Type> typeSelector)

public SearchDescriptor<T> DefaultOperator(DefaultOperator default_operator)

The default operator for query string query (AND or OR)

public SearchDescriptor<T> Df(string df)

The field to use as default where no field prefix is given in the query 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.

The operation will prefer to be executed on a local allocated shard is possible.

public SearchDescriptor<T> ExecuteOnNode(string node)

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

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.

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 go and be executed only on the primary shards.

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 go and be executed on the primary shard, and if not available (failover), will execute on other shards.

public SearchDescriptor<T> ExpandWildcards(ExpandWildcards expand_wildcards)

Whether to expand wildcard expression to concrete indices that are open, closed or both.

public SearchDescriptor<T> Explain(bool explain = true)

Enables explanation for each hit on how its score was computed. (Use .DocumentsWithMetaData on the return results)

A specific histogram facet that can work with date field types enhancing it over the regular histogram facet.

A specific histogram facet that can work with date field types enhancing it over the regular histogram facet.

public SearchDescriptor<T> FacetFilter(string name, Func<FilterDescriptor<T>, FilterContainer> filterSelector)

A filter facet (not to be confused with a facet filter) allows you to return a count of the h its matching the filter. The filter itself can be expressed using the Query DSL. Note, filter facet filters are faster than query facet when using native filters (non query wrapper ones).

The geo_distance facet is a facet providing information for ranges of distances from a provided geo_point including count of the number of hits that fall within each range, and aggregation information (like total).

The geo_distance facet is a facet providing information for ranges of distances from a provided geo_point including count of the number of hits that fall within each range, and aggregation information (like total).

The histogram facet works with numeric data by building a histogram across intervals of the field values. Each value is “rounded” into an interval (or placed in a bucket), and statistics are provided per interval/bucket (count and total).

The histogram facet works with numeric data by building a histogram across intervals of the field values. Each value is “rounded” into an interval (or placed in a bucket), and statistics are provided per interval/bucket (count and total).

public SearchDescriptor<T> FacetQuery(string name, Func<QueryDescriptor<T>, QueryContainer> querySelector, bool? Global = default)

A facet query allows to return a count of the hits matching the facet query. The query itself can be expressed using the Query DSL.

public SearchDescriptor<T> FacetRange<K>(string name, Func<RangeFacetDescriptor<T, K>, RangeFacetDescriptor<T, K>> facet) where K : struct

range facet allow to specify a set of ranges and get both the number of docs (count) that fall within each range, and aggregated data either based on the field, or using another field

public SearchDescriptor<T> FacetRange<K>(Func<RangeFacetDescriptor<T, K>, RangeFacetDescriptor<T, K>> facet, string Name = null) where K : struct

range facet allow to specify a set of ranges and get both the number of docs (count) that fall within each range, and aggregated data either based on the field, or using another field

Statistical facet allows to compute statistical data on a numeric fields. The statistical data include count, total, sum of squares, mean (average), minimum, maximum, variance, and standard deviation.

Statistical facet allows to compute statistical data on a numeric fields. The statistical data include count, total, sum of squares, mean (average), minimum, maximum, variance, and standard deviation.

Allow to specify field facets that return the N most frequent terms.

public SearchDescriptor<T> FacetTerm(Func<TermFacetDescriptor<T>, TermFacetDescriptor<T>> facet, string Name = null)

Allow to specify field facets that return the N most frequent terms.

The terms_stats facet combines both the terms and statistical allowing to compute stats computed on a field, per term value driven by another field.

The terms_stats facet combines both the terms and statistical allowing to compute stats computed on a field, per term value driven by another field.

public SearchDescriptor<T> FielddataFields(string[] fielddataFields)

A comma-separated list of fields to return as the field data representation of a field for each hit

public SearchDescriptor<T> FielddataFields(Expression<Func<T, object>>[] fielddataFields)

A comma-separated list of fields to return as the field data representation of a field for each hit

public SearchDescriptor<T> Fields(Expression<Func<T, object>>[] expressions)

Allows to selectively load specific fields for each document represented by a search hit. Defaults to load the internal _source field.

Allows to selectively load specific fields for each document represented by a search hit. Defaults to load the internal _source field.

public SearchDescriptor<T> Fields(string[] fields)

Allows to selectively load specific fields for each document represented by a search hit. Defaults to load the internal _source field.

Filter search using a filter descriptor lambda

public SearchDescriptor<T> Filter(FilterContainer filterDescriptor)

Filter search

public SearchDescriptor<T> FilterPath(string filter_path)

Comma separated list of filters used to reduce the response returned by Elasticsearch

public SearchDescriptor<T> FilterRaw(string rawFilter)

Filter search using a raw json string

public SearchDescriptor<T> From(int from)

The starting from index of the hits to return. Defaults to 0.

public SearchDescriptor<T> Highlight(Action<HighlightDescriptor<T>> highlightDescriptor)

Allow to highlight search results on one or more fields. The implementation uses the either lucene fast-vector-highlighter or highlighter.

public SearchDescriptor<T> IgnoreUnavailable(bool ignore_unavailable = true)

Whether specified concrete indices should be ignored when unavailable (missing or closed)

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).

public SearchDescriptor<T> Lenient(bool lenient = true)

Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

public SearchDescriptor<T> LowercaseExpandedTerms(bool lowercase_expanded_terms = true)

Specify whether query terms should be lowercased

Shorthand for a match_all query without having to specify .Query(q=>q.MatchAll())

public SearchDescriptor<T> MinScore(double minScore)

Allows to filter out documents based on a minimum score:

public SearchDescriptor<T> Preference(string preference)

Specify the node or shard the operation should be performed on (default: random)

Describe the query to perform using a query descriptor lambda

Describe the query to perform using the static Query class

public SearchDescriptor<T> QueryCache(bool query_cache = true)

Specify if query cache should be used for this request or not, defaults to index level setting

public SearchDescriptor<T> QueryRaw(string rawQuery)

Describe the query to perform as a raw json string

public SearchDescriptor<T> QueryString(string userInput)

Shortcut to .Query(q=>q.QueryString(qs=>qs.Query("string")) Does a match_all if the userInput string is null or empty;

public SearchDescriptor<T> Rescore(Action<RescoreDescriptor<T>> rescoreSelector)

Allows you to specify a rescore query

public SearchDescriptor<T> Routing(string[] routing)

A comma-separated list of specific routing values

public SearchDescriptor<T> Scroll(string scroll)

Specify how long a consistent view of the index should be maintained for scrolled search

public SearchDescriptor<T> SearchType(SearchType search_type)

Search operation type

public SearchDescriptor<T> Size(int size)

The number of hits to return. Defaults to 10. When using scroll search type size is actually multiplied by the number of shards!

public SearchDescriptor<T> Skip(int skip)

The starting from index of the hits to return. Defaults to 0.

Sort() allows you to fully describe your sort unlike the SortAscending and SortDescending aliases.

public SearchDescriptor<T> SortAscending(Expression<Func<T, object>> objectPath)

Allows to add one or more sort on specific fields. Each sort can be reversed as well. The sort is defined on a per field level, with special field name for _score to sort by score.

Sort ascending.

public SearchDescriptor<T> SortAscending(string field)

Allows to add one or more sort on specific fields. Each sort can be reversed as well. The sort is defined on a per field level, with special field name for _score to sort by score.

Sort ascending.

public SearchDescriptor<T> SortDescending(Expression<Func<T, object>> objectPath)

Allows to add one or more sort on specific fields. Each sort can be reversed as well. The sort is defined on a per field level, with special field name for _score to sort by score.

Sort descending.

public SearchDescriptor<T> SortDescending(string field)

Allows to add one or more sort on specific fields. Each sort can be reversed as well. The sort is defined on a per field level, with special field name for _score to sort by score.

Sort descending.

SortGeoDistance() allows you to sort by a distance from a geo point.

SortMulti allows multiple sorts to be provided on one search descriptor

SortMulti allows multiple sorts to be provided on one search descriptor

SortScript() allows you to sort by a distance from a geo point.

public SearchDescriptor<T> Source(bool include = true)

public SearchDescriptor<T> Stats(string[] stats)

Specific 'tag' of the request for logging and statistical purposes

public SearchDescriptor<T> Strict(bool strict = true)

When strict is set, conditionless queries are treated as an exception.

The completion suggester is a so-called prefix suggester. It does not do spell correction like the term or phrase suggesters but allows basic auto-complete functionality.

public SearchDescriptor<T> SuggestField(string suggest_field)

Specify which field to use for suggestions

public SearchDescriptor<T> SuggestField(Expression<Func<T, object>> typedPathLookup)

Specify which field to use for suggestions

public SearchDescriptor<T> SuggestMode(SuggestMode suggest_mode)

Specify suggest mode

The phrase suggester adds additional logic on top of the term suggester to select entire corrected phrases instead of individual tokens weighted based on ngram-langugage models.

public SearchDescriptor<T> SuggestSize(long suggest_size)

How many suggestions to return in response

The term suggester suggests terms based on edit distance. The provided suggest text is analyzed before terms are suggested. The suggested terms are provided per analyzed suggest text token. The term suggester doesn’t take the query into account that is part of request.

public SearchDescriptor<T> SuggestText(string suggest_text)

The source text for which the suggestions should be returned

public SearchDescriptor<T> Take(int take)

The number of hits to return. Defaults to 10.

public SearchDescriptor<T> TerminateAfter(long terminateAfter)

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.

public SearchDescriptor<T> Timeout(string timeout)

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.

public SearchDescriptor<T> TrackScores(bool trackscores = true)

Make sure we keep calculating score even if we are sorting on a field.

public SearchDescriptor<T> Version(bool version = true)

Returns a version for each search hit. (Use .DocumentsWithMetaData on the return results)