Class SimpleQueryStringQueryDescriptor<T>
A query that uses the SimpleQueryParser to parse its context.
Unlike the regular IQueryStringQuery, the ISimpleQueryStringQuery query will
never throw an exception, and discards invalid parts of the query.
Inheritance
SimpleQueryStringQueryDescriptor<T>
Assembly: OpenSearch.Client.dll
Syntax
public class SimpleQueryStringQueryDescriptor<T> : QueryDescriptorBase<SimpleQueryStringQueryDescriptor<T>, ISimpleQueryStringQuery>, IDescriptor, ISimpleQueryStringQuery, IQuery where T : class
Type Parameters
Properties
|
Edit this page
View Source
Conditionless
Whether the query is conditionless. A conditionless query is not serialized as part of the request
sent to OpenSearch.
Declaration
protected override bool Conditionless { get; }
Property Value
Overrides
Methods
|
Edit this page
View Source
AnalyzeWildcard(bool?)
By default, wildcards terms in a query are not analyzed.
By setting this value to true
, a best effort will be made to analyze those as well.
Declaration
public SimpleQueryStringQueryDescriptor<T> AnalyzeWildcard(bool? analyzeWildcard = true)
Parameters
Type |
Name |
Description |
bool? |
analyzeWildcard |
|
Returns
|
Edit this page
View Source
Analyzer(string)
The analyzer name used to analyze the query
Declaration
public SimpleQueryStringQueryDescriptor<T> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
AutoGenerateSynonymsPhraseQuery(bool?)
Declaration
public SimpleQueryStringQueryDescriptor<T> AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true)
Parameters
Type |
Name |
Description |
bool? |
autoGenerateSynonymsPhraseQuery |
|
Returns
|
Edit this page
View Source
DefaultOperator(Operator?)
The default operator used if no explicit operator is specified
The default operator is Or
Declaration
public SimpleQueryStringQueryDescriptor<T> DefaultOperator(Operator? op)
Parameters
Returns
|
Edit this page
View Source
Fields(Fields)
The fields to perform the parsed query against.
Defaults to the index.query.default_field
index settings, which in turn defaults to
.
extracts all fields in the mapping that are eligible to term queries and filters the metadata fields.
Declaration
public SimpleQueryStringQueryDescriptor<T> Fields(Fields fields)
Parameters
Type |
Name |
Description |
Fields |
fields |
|
Returns
|
Edit this page
View Source
Fields(Func<FieldsDescriptor<T>, IPromise<Fields>>)
The fields to perform the parsed query against.
Defaults to the index.query.default_field
index settings, which in turn defaults to
.
extracts all fields in the mapping that are eligible to term queries and filters the metadata fields.
Declaration
public SimpleQueryStringQueryDescriptor<T> Fields(Func<FieldsDescriptor<T>, IPromise<Fields>> fields)
Parameters
Returns
|
Edit this page
View Source
Flags(SimpleQueryStringFlags?)
Flags specifying which features to enable.
Defaults to All.
Declaration
public SimpleQueryStringQueryDescriptor<T> Flags(SimpleQueryStringFlags? flags)
Parameters
Returns
|
Edit this page
View Source
FuzzyMaxExpansions(int?)
Controls the number of terms fuzzy queries will expand to. Defaults to 50
Declaration
public SimpleQueryStringQueryDescriptor<T> FuzzyMaxExpansions(int? fuzzyMaxExpansions)
Parameters
Type |
Name |
Description |
int? |
fuzzyMaxExpansions |
|
Returns
|
Edit this page
View Source
FuzzyPrefixLength(int?)
Set the prefix length for fuzzy queries. Default is 0
Declaration
public SimpleQueryStringQueryDescriptor<T> FuzzyPrefixLength(int? fuzzyPrefixLength)
Parameters
Type |
Name |
Description |
int? |
fuzzyPrefixLength |
|
Returns
|
Edit this page
View Source
FuzzyTranspositions(bool?)
Sets whether transpositions are supported in fuzzy queries. Default is true
.
The default metric used by fuzzy queries to determine a match is the Damerau-Levenshtein
distance formula which supports transpositions. Setting transposition to false will
switch to classic Levenshtein distance.
If not set, Damerau-Levenshtein distance metric will be used.
Declaration
public SimpleQueryStringQueryDescriptor<T> FuzzyTranspositions(bool? fuzzyTranspositions = true)
Parameters
Type |
Name |
Description |
bool? |
fuzzyTranspositions |
|
Returns
|
Edit this page
View Source
Lenient(bool?)
If set to true
will cause format based failures (like providing text to a numeric field)
to be ignored
Declaration
public SimpleQueryStringQueryDescriptor<T> Lenient(bool? lenient = true)
Parameters
Type |
Name |
Description |
bool? |
lenient |
|
Returns
|
Edit this page
View Source
MinimumShouldMatch(MinimumShouldMatch)
A value controlling how many "should" clauses in the resulting boolean query should match.
It can be an absolute value, a percentage or a combination of both
Declaration
public SimpleQueryStringQueryDescriptor<T> MinimumShouldMatch(MinimumShouldMatch minimumShouldMatch)
Parameters
Returns
|
Edit this page
View Source
Query(string)
Declaration
public SimpleQueryStringQueryDescriptor<T> Query(string query)
Parameters
Type |
Name |
Description |
string |
query |
|
Returns
|
Edit this page
View Source
QuoteFieldSuffix(string)
A suffix to append to fields for quoted parts of the query string.
This allows to use a field that has a different analysis chain for exact matching.
Declaration
public SimpleQueryStringQueryDescriptor<T> QuoteFieldSuffix(string quoteFieldSuffix)
Parameters
Type |
Name |
Description |
string |
quoteFieldSuffix |
|
Returns
Implements
Extension Methods