Amazon Elasticsearch Service
Developer Guide (API Version 2015-01-01)

SQL Support for Amazon Elasticsearch Service

SQL support for Amazon Elasticsearch Service lets you query your data using SQL rather than the JSON-based Elasticsearch query DSL. This feature is useful if you're already familiar with SQL or want to integrate your domain with an application that uses SQL.

SQL support is available on domains running Elasticsearch 6.5 or higher. Full documentation is available in the Open Distro for Elasticsearch documentation.

Sample Call

To query your data using SQL, send HTTP requests to _opendistro/_sql using the following format:

POST elasticsearch_domain/_opendistro/_sql { "query": "SELECT * FROM my-index LIMIT 50" }

Notes and Differences

Calls to _opendistro/_sql include index names in the request body and thus have the same access policy considerations as the bulk, mget, and msearch APIs. As always, follow the principle of least privilege when granting permissions to APIs.

JDBC Driver

The Java Database Connectivity (JDBC) driver lets you integrate Amazon ES domains with your favorite business intelligence (BI) applications. To get started, see the GitHub repository. The following table summarizes version compatibility for the driver.

Elasticsearch Version JDBC Driver Version
6.5 0.9.0