Class QueryStringQueryDescriptor<T>
A query that uses a query parser in order to parse its content
Inheritance
QueryStringQueryDescriptor<T>
Assembly: OpenSearch.Client.dll
Syntax
[DataContract]
public class QueryStringQueryDescriptor<T> : QueryDescriptorBase<QueryStringQueryDescriptor<T>, IQueryStringQuery>, IDescriptor, IQueryStringQuery, 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
AllowLeadingWildcard(bool?)
When set, *
or ?
are allowed as the first character. Defaults to true
.
Declaration
public QueryStringQueryDescriptor<T> AllowLeadingWildcard(bool? allowLeadingWildcard = true)
Parameters
Type |
Name |
Description |
bool? |
allowLeadingWildcard |
|
Returns
|
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 QueryStringQueryDescriptor<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 QueryStringQueryDescriptor<T> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
AutoGenerateSynonymsPhraseQuery(bool?)
Declaration
public QueryStringQueryDescriptor<T> AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true)
Parameters
Type |
Name |
Description |
bool? |
autoGenerateSynonymsPhraseQuery |
|
Returns
|
Edit this page
View Source
DefaultField(Field)
The default field for query terms if no prefix field is specified.
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.
All extracted fields are then combined to build a query when no prefix field is provided.
Declaration
public QueryStringQueryDescriptor<T> DefaultField(Field field)
Parameters
Type |
Name |
Description |
Field |
field |
|
Returns
|
Edit this page
View Source
DefaultField<TValue>(Expression<Func<T, TValue>>)
The default field for query terms if no prefix field is specified.
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.
All extracted fields are then combined to build a query when no prefix field is provided.
Declaration
public QueryStringQueryDescriptor<T> DefaultField<TValue>(Expression<Func<T, TValue>> field)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
DefaultOperator(Operator?)
The default operator used if no explicit operator is specified.
The default operator is Or
Declaration
public QueryStringQueryDescriptor<T> DefaultOperator(Operator? op)
Parameters
Returns
|
Edit this page
View Source
EnablePositionIncrements(bool?)
Set to true
to enable position increments in result queries. Defaults to true
.
Declaration
public QueryStringQueryDescriptor<T> EnablePositionIncrements(bool? enablePositionIncrements = true)
Parameters
Type |
Name |
Description |
bool? |
enablePositionIncrements |
|
Returns
|
Edit this page
View Source
Escape(bool?)
Enables escaping of the query
Declaration
public QueryStringQueryDescriptor<T> Escape(bool? escape = true)
Parameters
Type |
Name |
Description |
bool? |
escape |
|
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 QueryStringQueryDescriptor<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 QueryStringQueryDescriptor<T> Fields(Func<FieldsDescriptor<T>, IPromise<Fields>> fields)
Parameters
Returns
|
Edit this page
View Source
Fuzziness(Fuzziness)
Set the fuzziness for fuzzy queries. Defaults to Auto
Declaration
public QueryStringQueryDescriptor<T> Fuzziness(Fuzziness fuzziness)
Parameters
Returns
|
Edit this page
View Source
FuzzyMaxExpansions(int?)
Controls the number of terms fuzzy queries will expand to. Defaults to 50
Declaration
public QueryStringQueryDescriptor<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 QueryStringQueryDescriptor<T> FuzzyPrefixLength(int? fuzzyPrefixLength)
Parameters
Type |
Name |
Description |
int? |
fuzzyPrefixLength |
|
Returns
|
Edit this page
View Source
FuzzyRewrite(MultiTermQueryRewrite)
Declaration
public QueryStringQueryDescriptor<T> FuzzyRewrite(MultiTermQueryRewrite rewrite)
Parameters
Returns
|
Edit this page
View Source
FuzzyTranspositions(bool?)
Sets whether transpositions are supported in fuzzy queries.
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 QueryStringQueryDescriptor<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 QueryStringQueryDescriptor<T> Lenient(bool? lenient = true)
Parameters
Type |
Name |
Description |
bool? |
lenient |
|
Returns
|
Edit this page
View Source
MaximumDeterminizedStates(int?)
Limit on how many automaton states regexp queries are allowed to create.
This protects against too-difficult (e.g. exponentially hard) regexps.
Defaults to 10000
.
Declaration
public QueryStringQueryDescriptor<T> MaximumDeterminizedStates(int? maxDeterminizedStates)
Parameters
Type |
Name |
Description |
int? |
maxDeterminizedStates |
|
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 QueryStringQueryDescriptor<T> MinimumShouldMatch(MinimumShouldMatch minimumShouldMatch)
Parameters
Returns
|
Edit this page
View Source
PhraseSlop(double?)
Sets the default slop for phrases. If zero, then exact phrase matches are required.
Default value is 0
.
Declaration
public QueryStringQueryDescriptor<T> PhraseSlop(double? phraseSlop)
Parameters
Type |
Name |
Description |
double? |
phraseSlop |
|
Returns
|
Edit this page
View Source
Query(string)
Declaration
public QueryStringQueryDescriptor<T> Query(string query)
Parameters
Type |
Name |
Description |
string |
query |
|
Returns
|
Edit this page
View Source
QuoteAnalyzer(string)
The name of the analyzer that is used to analyze quoted phrases in the query string.
For those parts, it overrides other analyzers that are set using the analyzer parameter
or the search_quote_analyzer setting.
Declaration
public QueryStringQueryDescriptor<T> QuoteAnalyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
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 QueryStringQueryDescriptor<T> QuoteFieldSuffix(string quoteFieldSuffix)
Parameters
Type |
Name |
Description |
string |
quoteFieldSuffix |
|
Returns
|
Edit this page
View Source
Rewrite(MultiTermQueryRewrite)
Controls how a multi term query such as a wildcard or prefix query, is rewritten.
Declaration
public QueryStringQueryDescriptor<T> Rewrite(MultiTermQueryRewrite rewrite)
Parameters
Returns
|
Edit this page
View Source
TieBreaker(double?)
The disjunction max tie breaker for multi fields. Defaults to 0
Declaration
public QueryStringQueryDescriptor<T> TieBreaker(double? tieBreaker)
Parameters
Type |
Name |
Description |
double? |
tieBreaker |
|
Returns
|
Edit this page
View Source
TimeZone(string)
Time Zone to be applied to any range query related to dates.
Declaration
public QueryStringQueryDescriptor<T> TimeZone(string timezone)
Parameters
Type |
Name |
Description |
string |
timezone |
|
Returns
|
Edit this page
View Source
Type(TextQueryType?)
How the fields should be combined to build the text query.
Default is BestFields
Declaration
public QueryStringQueryDescriptor<T> Type(TextQueryType? type)
Parameters
Returns
Implements
Extension Methods