Basic Usage

range_term filters over int4range, int8range, numrange, tsrange, and tstzrange range fields.

The following query finds all ranges that contain a specific value:

range_term can be used with boolean queries to “push down” the range filter into the full text search query.

Range Comparison

In addition to individual terms, range_term can also compare a Postgres range against the range field.

Intersects

The following query finds all ranges that share at least one common point with the query range:

Based on the SearchQueryInput enum showing RangeIntersects as an option, here’s how we would write it:

Contains

The following query finds all ranges that are contained by the query range:

Within

The following query finds all ranges that contain the query range: