Overview
In addition to query strings, JSONB
query objects and query builder functions
can be used to compose various types of more complex queries.
If you are familiar with Elasticsearch’s API, you may notice that the available query types are similar to those found in Elastic’s query DSL. This is intentional — ParadeDB uses the same terminology as Elasticsearch for its query types.
Basic Usage
The left-hand side of @@@
must be the key field
and the right-hand side should be either a JSON object or query builder function. For instance, the following code block
executes a match query.
The JSON object and query builder function syntaxes are interchangeable, giving you the freedom to decide what’s easier for your application to write.
The JSON query object must be explicitly cast to JSONB
using ::jsonb
.
JSON syntax queries can accept datetime values as strings. To disambiguate
these from string values, you should set "is_datetime": true
in the query
parameters.