Skip to main content

parse

Description

Controls how input text is interpreted and parsed into a structured filter

Use it to choose between full structured parsing with a free-text fallback, strict field-only syntax enforcement, or disabling parsing entirely when you want to handle the raw input yourself.

Usage

parse?: "none" | "strict" | "allowFreeText";

Default: "allowFreeText"

  • "allowFreeText" - (default) Parses structured field-value syntax (status: Open) and also accepts plain words as free-text search. Unrecognized words are matched as contains-filters across all text fields.
  • "strict" - Parses only valid field-value syntax. Any text that does not match a known field or operator is highlighted as an error, and the onChange event receives a validation error.
  • "none" - Disables parsing entirely. Syntax highlighting and autocomplete are turned off. The onChange event receives the raw query string as value instead of structured group of filtering rules.

Example

{/* Default: structured queries plus free-text fallback */}
<FilterQuery fields={fields} parse="allowFreeText" onChange={handleChange} />

{/* Strict: only valid field syntax is accepted */}
<FilterQuery fields={fields} parse="strict" onChange={handleChange} />

{/* Disabled: forward raw input to an AI or NLP endpoint */}
<FilterQuery parse="none" onChange={({ value }) => sendToBackend(value)} />

Related articles: Filtering data