Files
6af66500eb Remove admin:admin default and update instructions for demo setup (#5887)
* Update some admin:admin references

Signed-off-by: Derek Ho <[email protected]>

* Update all references except for helm

Signed-off-by: Derek Ho <[email protected]>

* Update helm

Signed-off-by: Derek Ho <[email protected]>

* Reverts changes made to _install-and-configure folder

Signed-off-by: Darshit Chanpura <[email protected]>

* Apply suggestions from code review

Co-authored-by: Naarcha-AWS <[email protected]>
Signed-off-by: Derek Ho <[email protected]>

* Update _about/quickstart.md

Signed-off-by: Naarcha-AWS <[email protected]>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>

* Update quickstart.md

Signed-off-by: Naarcha-AWS <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Co-authored-by: Darshit Chanpura <[email protected]>
Co-authored-by: Darshit Chanpura <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
2024-02-01 11:01:58 -08:00

2.1 KiB
Raw Permalink Blame History

layout, title, parent, nav_order, has_children, has_toc, redirect_from
layout title parent nav_order has_children has_toc redirect_from
default SQL SQL and PPL 4 true false
/search-plugins/sql/sql/index/

SQL

SQL in OpenSearch bridges the gap between traditional relational database concepts and the flexibility of OpenSearch's document-oriented data storage. This integration gives you the ability to use your SQL knowledge to query, analyze, and extract insights from your OpenSearch data.

SQL and OpenSearch terminology

Heres how core SQL concepts map to OpenSearch:

SQL OpenSearch
Table Index
Row Document
Column Field

REST API

For a complete REST API reference for the SQL plugin, see SQL/PPL API.

To use the SQL plugin with your own applications, send requests to the _plugins/_sql endpoint:

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

{% include copy-curl.html %}

You can query multiple indexes by using a comma-separated list:

POST _plugins/_sql
{
  "query": "SELECT * FROM my-index1,myindex2,myindex3 LIMIT 50"
}

{% include copy-curl.html %}

You can specify an index pattern with a wildcard expression:

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

{% include copy-curl.html %}

To run the preceding query in the command line, use the curl command:

curl -XPOST https://localhost:9200/_plugins/_sql -u 'admin:<custom-admin-password>' -k -H 'Content-Type: application/json' -d '{"query": "SELECT * FROM my-index* LIMIT 50"}'

{% include copy.html %}

You can specify the response format as JDBC, standard OpenSearch JSON, CSV, or raw. By default, queries return data in JDBC format. The following query sets the format to JSON:

POST _plugins/_sql?format=json
{
  "query": "SELECT * FROM my-index LIMIT 50"
}

{% include copy-curl.html %}

For more information about request parameters, settings, supported operations, and tools, see the related topics under SQL.