booleanField
const booleanField: (input) => ElasticsearchFieldSpec;Defined in: filters/elasticsearch.ts:119
Allow-list a public field as a boolean filter (eq/ne/null checks) over a boolean
field. ne keeps SQL semantics: documents without the field don’t match.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ field: string; } |
input.field |
string |
Returns
Section titled “Returns”Example
Section titled “Example”import { booleanField, buildQuery } from "@xtandard/lib/filters/elasticsearch";
const { query } = buildQuery({ spec: { done: booleanField({ field: "done" }) }, filters: [{ field: "done", filter: { kind: "boolean", operator: "ne", value: true } }],});// query → { bool: { filter: [{ exists: { field: "done" } }], must_not: [{ term: { done: true } }] } }