Using DSL to Search for Data in OpenSearch

DSL is the specified query language for OpenSearch. It is the best language for interaction between OpenSearch clusters and clients. OpenSearch DSL is a JSON-based language. Other languages, such as SQL, are translated into OpenSearch DSL before they can be used for interacting with OpenSearch clusters.

This topic lists some of the most commonly used OpenSearch DSL query statements. For more, see Query DSL.

DSL Usage Example

Compile the request content in JSON format on the Dev Tools page of OpenSearch Dashboards and execute the search request.

For example, run the following command to retrieve all documents in the test index:

1
2
3
4
5
6
GET /test/_search
{
  "query": {
    "match_all": {}
  }
}

The search result is also in JSON format.

Common DSL Query Statements