Update UI screenshots and make copy edits to content --------- Signed-off-by: Melissa Vagi <vagimeli@amazon.com> Co-authored-by: Nathan Bower <nbower@amazon.com>
4.0 KiB
layout | title | parent | nav_order | redirect_from | |
---|---|---|---|---|---|
default | Running queries in the Dev Tools console | Dev Tools | 10 |
|
Running queries in the Dev Tools console
The Dev Tools console can be used to send queries to OpenSearch. To access the console, go to the OpenSearch Dashboards main menu and select Management > Dev Tools.
Writing queries
OpenSearch provides a query domain-specific language (DSL) called Query DSL. It is a flexible language with a JSON interface.
To write your queries, use the editor pane on the left side of the console. To send a query to OpenSearch, select the query by placing the cursor in the query text and then selecting the play icon ({::nomarkdown}{:/}) on the upper right of the request or press
Ctrl/Cmd+Enter
. The response from OpenSearch is displayed in the response pane on the right side of the console. To run multiple commands simultaneously, select all the commands in the editor pane, and then select the play icon or press Ctrl/Cmd+Enter
.
An example of the query and response panes is shown in the following image.

Query options
When writing queries using the console, there are common actions that can help you write queries more efficiently and accurately. The following table describes these features and how you can use them.
Working in the cURL and console formats
The console uses a simplified syntax to format REST requests instead of the curl
command. If you paste a curl
command directly into the console, the command is automatically converted into the format used by the console. To import a query in cURL format, select the query, then select the wrench icon ({::nomarkdown}{:/}), and choose Copy as cURL.
For example, the following curl
command runs a search query:
curl -XGET http://localhost:9200/shakespeare/_search?pretty -H 'Content-Type: application/json' -d'
{
"query": {
"match": {
"text_entry": "To be, or not to be"
}
}
}'
{% include copy.html %}
The same query has a simplified syntax in the console format, as shown in the following example:
GET shakespeare/_search
{
"query": {
"match": {
"text_entry": "To be, or not to be"
}
}
}
{% include copy-curl.html %}