Link Search Menu Expand Document Documentation Menu

You're viewing version 2.0 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

Query Workbench

Use the Query Workbench to easily run on-demand SQL queries, translate SQL into its REST equivalent, and view and save results as text, JSON, JDBC, or CSV.

Quick start

To get started with SQL Workbench, choose Dev Tools in OpenSearch Dashboards and use the bulk operation to index some sample data:

PUT accounts/_bulk?refresh
{"account_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes Lane","employer":"Pyrami","email":"","city":"Brogan","state":"IL"}
{"account_number":6,"balance":5686,"firstname":"Hattie","lastname":"Bond","age":36,"gender":"M","address":"671 Bristol Street","employer":"Netagy","email":"","city":"Dante","state":"TN"}
{"account_number":13,"balance":32838,"firstname":"Nanette","lastname":"Bates","age":28,"gender":"F","address":"789 Madison Street","employer":"Quility","email":"","city":"Nogal","state":"VA"}
{"account_number":18,"balance":4180,"firstname":"Dale","lastname":"Adams","age":33,"gender":"M","address":"467 Hutchinson Court","email":"","city":"Orick","state":"MD"}

Then return to SQL Workbench.

List indices

To list all your indices:


Read data

After you index a document, retrieve it using the following SQL expression:

FROM accounts
WHERE _id = 1
account_number firstname gender city balance employer state email address lastname age
1 Amber M Brogan 39225 Pyrami IL 880 Holmes Lane Duke 32

Delete data

To delete a document from an index, use the DELETE clause:

FROM accounts
WHERE _id = 0
350 characters left

Have a question? .

Want to contribute? or .