Using DSL to Search for Data in Elasticsearch

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

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

DSL Usage Example

Compile the request content in JSON format on the Dev Tools page of Kibana 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