You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Separated the ESQL endpoint formats docs in 3 blocks: Structured, Tabular and Binary (Open to suggestions for the names here).
Initially, it was only "Human readable" and "Binary". But CSV, TSV and TXT are different from JSON and YAML, as they don't show all the results, only the query results as a table (For example, no "took" or "is_partial" fields).
API specification change: elastic/elasticsearch-specification#5054
Copy file name to clipboardExpand all lines: explore-analyze/query-filter/languages/esql-rest.md
+34-6Lines changed: 34 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,26 +60,49 @@ POST /_query?format=txt
60
60
61
61
{{esql}} can return the data in the following human readable and binary formats. You can set the format by specifying the `format` parameter in the URL or by setting the `Accept` or `Content-Type` HTTP header.
62
62
63
+
For example:
64
+
65
+
```console
66
+
POST /_query?format=yaml
67
+
```
68
+
63
69
::::{note}
64
70
The URL parameter takes precedence over the HTTP headers. If neither is specified then the response is returned in the same format as the request.
65
71
::::
66
72
73
+
#### Structured formats
74
+
75
+
Complete responses with metadata. Useful for automatic parsing.
|`yaml`|`application/yaml`|[YAML](https://en.wikipedia.org/wiki/YAML) (YAML Ain’t Markup Language) human-readable format |
76
-
| Binary |
91
+
92
+
::::{tip}
93
+
The `csv` format accepts a formatting URL query attribute, `delimiter`, which indicates which character should be used to separate the CSV values. It defaults to comma (`,`) and cannot take any of the following values: double quote (`"`), carriage-return (`\r`) and new-line (`\n`). The tab (`\t`) can also not be used. Use the `tsv` format instead.
94
+
::::
95
+
96
+
#### Binary formats
97
+
98
+
Compact binary encoding. To be used by applications.
The `csv` format accepts a formatting URL query attribute, `delimiter`, which indicates which character should be used to separate the CSV values. It defaults to comma (`,`) and cannot take any of the following values: double quote (`"`), carriage-return (`\r`) and new-line (`\n`). The tab (`\t`) can also not be used. Use the `tsv` format instead.
82
-
83
106
84
107
### Filtering using {{es}} Query DSL [esql-rest-filtering]
85
108
@@ -322,3 +345,8 @@ Use the [{{esql}} async query delete API](https://www.elastic.co/docs/api/doc/el
You will also receive the async ID and running status in the `X-Elasticsearch-Async-Id` and `X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
351
+
Useful if you use a tabular text format like `txt`, `csv` or `tsv`, as you won't receive those fields in the body there.
0 commit comments