Skip to main content
LambdaDB supports a simple string query that uses the Lucene Query Syntax to search documents. This gives 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

When multiple terms are separated by spaces, each term is treated as an optional clause on the defaultField. The above example is equivalent to:
You can also query multiple fields by specifying field names in the query string. Terms are separated by spaces, and specific fields are targeted using the field:value syntax:

Exact keyword match

Use a keyword field when you want to match a literal value instead of analyzed text.
If the keyword contains spaces or query syntax characters, wrap the value in double quotes ("):
For raw literal values that include special characters, you can also use the skipSyntax option:
Alternatively, quote the literal value:
On analyzed text fields, wrap terms in double quotes (") to search for an exact phrase.
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.
You can also boost a grouped sub-query:

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 the fn: prefix to express ordered or positional relationships between terms.
You can target a field and combine interval functions:

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:
  • long
  • double
  • datetime
  • keyword

Syntax

  • Inclusive range: [min TO max] includes both lower and upper bounds.
  • Exclusive range: {min TO max} excludes both lower and upper bounds.