**同步结果摘要**: | 目录 | 同步前 | 同步后 | 官方 | |------|--------|--------|------| | aggregations | 40 | 65 | 64 | | analyzers | 8 | 141 | 140 | | api-reference | 97 | 186 | 174 | | benchmark | 34 | 67 | 53 | | clients | 17 | 18 | 18 | | dashboards | 38 | 149 | 131 | | data-prepper | 77 | 134 | 123 | | im-plugin | 22 | 37 | 37 | | ingest-pipelines | 27 | 52 | 51 | | install-and-configure | 37 | 57 | 53 | | ml-commons-plugin | 81 | 157 | 155 | | observing-your-data | 39 | 73 | 66 | | query-dsl | 40 | 77 | 75 | | search-plugins | 80 | 139 | 95 | | security-analytics | 22 | 47 | 46 | **说明**: - 本地文件数 > 官方:本地有一些官方已删除或重命名的文件 - 新增了约 **740 个英文文档文件** - 已有文件保持不变(未覆盖)
50 lines
2.1 KiB
Markdown
50 lines
2.1 KiB
Markdown
---
|
|
layout: default
|
|
title: Run queries in the Dev Tools console
|
|
parent: Getting started
|
|
nav_order: 50
|
|
---
|
|
|
|
# Run queries in the Dev Tools console
|
|
|
|
The Dev Tools console lets you send [Query DSL]({{site.url}}{{site.baseurl}}/query-dsl/) queries to OpenSearch instead of using cURL in your terminal.
|
|
|
|
## Try it: Write and run a query
|
|
|
|
1. To open the Dev Tools console, select **Dev Tools** on the main OpenSearch Dashboards page or select **Management** > **Dev Tools** from the left navigation menu. In installations with workspaces enabled, select the code icon ({::nomarkdown}<img src="{{site.url}}{{site.baseurl}}/images/icons/code-icon.png" class="inline-icon" alt="code icon"/>{:/}) in the lower-left corner of the navigation panel.
|
|
|
|
2. Write a query in the editor pane on the left side of the console. For example, enter the following query to index some documents:
|
|
|
|
```json
|
|
POST _bulk
|
|
{ "create": { "_index": "students", "_id": "2" } }
|
|
{ "name": "Jonathan Powers", "gpa": 3.85, "grad_year": 2025 }
|
|
{ "create": { "_index": "students", "_id": "3" } }
|
|
{ "name": "Jane Doe", "gpa": 3.52, "grad_year": 2024 }
|
|
```
|
|
{% include copy.html %}
|
|
|
|
3. To send the query, place the cursor anywhere in the query text and select the play icon ({::nomarkdown}<img src="{{site.url}}{{site.baseurl}}/images/dev-tools/play-icon.png" class="inline-icon" alt="play icon"/>{:/}) on the upper right of the request, or press `Ctrl/Cmd+Enter`.
|
|
|
|
OpenSearch displays the response in the pane on the right side of the console.
|
|
|
|

|
|
|
|
4. Try a search query. Enter the following request to retrieve all documents from the `students` index:
|
|
|
|
```json
|
|
GET students/_search
|
|
{
|
|
"query": {
|
|
"match_all": {}
|
|
}
|
|
}
|
|
```
|
|
{% include copy.html %}
|
|
|
|
5. Select the play icon to send the request and view the results.
|
|
|
|
## Next steps
|
|
|
|
- For the full Dev Tools reference, see [Dev Tools]({{site.url}}{{site.baseurl}}/dashboards/dev-tools/index/).
|
|
- For the full query language reference, see [Query DSL]({{site.url}}{{site.baseurl}}/query-dsl/). |