tools

SQL to Elasticsearch converter

Paste a WHERE clause and get the Elasticsearch query DSL: a bool query you can drop into _search.

  • free
  • no sign-up
  • runs in your browser
  • MIT
input · SQL
output · Elasticsearch query DSL
5 rules · 5 fields · converted Runs in your browser: nothing leaves it.

How it converts

AND becomes bool.must, OR becomes bool.should with minimum_should_match: 1, and NOT becomes must_not. Equality is a term query, IN a terms query, comparisons and BETWEEN a range query, IS NULL a must_not exists.

LIKE patterns become case-insensitive wildcard queries with the pattern escaped. Map text fields you filter on as keyword, or declare them caseSensitive in your schema.

Use it in your app

follows your input and settings

The converter is qnot's codecs. Declare the fields once and the same two calls run on your server or in the browser, typed end to end.

Questions

Is my query sent anywhere?
No. The converter is qnot running in your browser: parsing, schema inference and conversion all happen on this page, and nothing you paste leaves your browser.
Does it use the Elasticsearch SQL API?
No. It writes the query DSL directly, so the output works on any cluster and in OpenSearch, without the SQL plugin. Paste the result under "query" in a _search request.
Why does it show a schema?
qnot's codecs are typed by a schema. The tool infers a permissive one from your input (numbers, booleans, dates, lists, nested arrays), so you can paste any query. In your app you declare the fields once with defineFields and get the same conversion with exact types.