williamcotton a day ago

I built this library after struggling with search interfaces in several projects. Most existing solutions were either too simple (just basic text matching) or required complex infrastructure like Elasticsearch.

This little project offers a middle ground - Elasticsearch-inspired query syntax that outputs to SQL. This means you can add powerful search to your app without changing your database stack.

Key features:

  * Multi-pass parser with comprehensive validation
  * Converts complex queries to SQL (supporting ILIKE, PostgreSQL tsvector, or ParadeDB)
  * React component with Monaco editor, syntax highlighting, and autocompletion
  * Full test coverage
The parser handles complex expressions like:

  (title:"winter boots" OR category:shoes) AND price:>100 AND date:2024-01..2024-03 
...and generates parameterized SQL ready to use with your ORM or database client.

I'd love feedback on the API design and React component - especially from those who've implemented search in their own applications. What search features do you wish were easier to implement?

The demo (in the repo) shows the full functionality. The GitHub README has an animated GIF of the demo app.

It's built with React + Monaco editor but the core parser has zero dependencies.