Reference Entry
RangeQuery Over Lexical Fields
Lexical Querying · querying · order 40
Filter sortable string terms with gt, gte, lt, and lte boundaries.
Relevant APIs
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.