- Notifications
You must be signed in to change notification settings - Fork4
Generic SQL to Elasticsearch DSL query translator
License
NotificationsYou must be signed in to change notification settings
QXIP/elasql
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Generic SQL to Elasticsearch DSL query translator. Designed forSENTINL
- Experimental - Join us hacking this!
npm install elasql
const convert = require('elasql').convertconvert('SELECT id,name FROM shop WHERE shop_id BETWEEN 5 AND 10 AND type = "cat"')
{ "query": { "bool": { "must": [ { "match": { "type": "cat" } } ], "must_not": [], "filter": [ { "range": { "shop_id": { "gte": { "type": "number", "value": 5 }, "lte": { "type": "number", "value": 10 } } } } ] } }, "aggregations": { "id": { "terms": { "field": "id" }, "aggregations": { "name": { "terms": { "field": "name" } } } } }}
(C) QXIP BV 2018, released under the MIT License