Searcher Demo

Interactive visualization of the search query parser. Type a query to see how it's parsed into a structured AST.

Query Input

Enter a search query using terms, attributes (key:value), and operators (AND, OR, XOR, EXCEPT, NOT).

Available keys: first_name, last_name, job, hometown (key-only), SSN (exact-only), Bio

Parsed Structure

Enter a query above to see the parsed structure

Records (Filtered)

When the query parses successfully, the records below are re-scored and grouped by score.

Loading demo records…

Syntax Reference

Operators (by precedence, tightest first)

  • NOT - Complement (unary, tightest binding)
  • AND - Intersection
  • EXCEPT - Difference (A minus B)
  • XOR - Symmetric Difference
  • OR - Union (loosest binding)

Primitive Syntax

  • Simple terms: foo bar baz
  • Quoted phrases: "hello world"
  • Attributes: name:john age:30
  • Quoted attribute values: name:"John Doe"

Grouping

  • Use parentheses to override precedence: (foo OR bar) AND baz

Examples

  • foo AND bar OR baz → (foo AND bar) OR baz
  • NOT foo AND bar → (NOT foo) AND bar
  • a XOR b EXCEPT c → (a XOR b) EXCEPT c