Querylight TS Demo

RangeQuery Over Lexical Fields

Filter sortable string terms with gt, gte, lt, and lte boundaries.

Back to docs search

Reference Entry

RangeQuery Over Lexical Fields

Lexical Querying · querying · order 40

Filter sortable string terms with gt, gte, lt, and lte boundaries.

RangeQuery Over Lexical Fields

RangeQuery compares string terms lexically. That works best when values are already sortable as strings.

Example

import { BoolQuery, RangeQuery } from "@tryformation/querylight-ts";

const query = new BoolQuery([], [], [
  new RangeQuery("order", { gte: "03", lte: "07" })
]);

Practical note

If you want numeric-style ordering, store values as zero-padded strings such as 01, 02, and 10.

Learn more