queryString access to expressive lexical search features such as terms, phrases, wildcards, boolean operators, range operators, proximity search, regular expressions, fuzzy term matching, term boosting, minimum-should-match constraints, interval functions, and special character escaping.
Supported syntax highlights
Parameters
A query to a collection with
object field type requires special handling.Examples
Basic query
defaultField.
The above example is equivalent to:
field:value syntax:
Exact keyword match
Use akeyword field when you want to match a literal value instead of analyzed text.
"):
skipSyntax option:
Phrase search
On analyzed text fields, wrap terms in double quotes (") to search for an exact phrase.
Proximity search
Use proximity search to match phrase terms that appear near each other, even when they are not adjacent. The number after~ controls the maximum distance between phrase terms.
Regular expression query
Wrap a regular expression in forward slashes (/) to match terms by pattern.
Fuzzy term matching
Use~ after a term to match terms within an edit distance.
This is useful for typos, spelling variants, and noisy text.
Term boosting
Use^ to increase or decrease the relevance weight of a term, phrase, range expression, or grouped clause.
Minimum should match
Use the minimum-should-match operator (@) on a disjunction group to require at least the specified number of optional clauses to match.
Interval function
Use interval functions with thefn: prefix to express ordered or positional relationships between terms.
Range query
Range queries allow you to search for values within a specific range using range query syntax.Supported field types
Range queries work with the following field types:longdoubledatetimekeyword
Syntax
- Inclusive range:
[min TO max]includes both lower and upper bounds. - Exclusive range:
{min TO max}excludes both lower and upper bounds.