-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support YAML in Dev Tools -> Console #28754
Comments
Pinging @elastic/es-ui |
@ypid-geberit |
I might add that I use YAML all over the place together with Elasticsearch. For example to write ES watches (elastic/examples#239) and thus also for queries. When you use Curator, you also end up writing queries in YAML. YAML is already present in Elasticsearch and people know/use it. Even the configuration file of Kibana is in YAML. To summaries this:
That is a third reason but the two reasons I mentioned already are my main reasons. I can go into more depth on those two if you want to. |
I am taking the Engineer I training right now, and was thinking this would be great to have. To elaborate on the "human editable and readable" part, YAML support would allow for much more concise queries while cutting down on the need for fiddly braces, quote marks, and commas. For example, this: GET blogs/_search
{
"query": {
"match": {
"title": {
"query": "open source software",
"minimum_should_match": 2
}
}
}
} Becomes: GET blogs/_search
query:
match:
title:
query: "open source software"
minimum_should_match: 2 |
^ or even: GET blogs/_search
query.match.title.query: "open source software"
query.match.title.minimum_should_match: 2 |
I'd love this feature. I spend about 50% of my time counting closing brackets. |
Another good reason could be to have multiline strings for scripts in YAML. GET hockey/_search
{
"query": {
"match_all": {}
},
"script_fields": {
"total_goals": {
"script": {
"lang": "painless",
"source": "int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total;"
}
}
}
} becomes: query:
match_all: {}
script_fields:
total_goals:
script:
lang: painless
source: >
int total = 0;
for (int i = 0; i < doc['goals'].length; ++i) {
total+= doc['goals'][i];
}
return total; |
Please consider adding this feature! |
Pinging @elastic/kibana-management (Team:Kibana Management) |
Describe the feature: Most APIs of Elasticsearch support YAML requests and ES can send responses also in YAML. Please consider supporting it also in Dev Tools -> Console. For completeness, "raw" filter blocks ("Edit Query DSL") should then also support YAML.
Describe a specific use case for the feature:
Stages of implementation
Content-Type: application/yaml
in the request. ES will then also answer YAML encoded.)Example:
The text was updated successfully, but these errors were encountered: