After reading the documentation for named queries, and attempting to perform some myself, I am thoroughly confused on how to name queries.
This doesn't work:
{
"term": {
"tag_id": 1,
"_name": "test"
}
}
{"reason": "[term] query doesn't support multiple fields, found [_name] and [tag_id]"}
Neither does this:
{
"bool": {
"must": [{"match_all": {}}],
},
"_name": "test"
}
{"reason": "[_name] query malformed, no start_object after query name"}
But this does:
{
"terms": {
"tag_id": [1],
"_name": "test"
}
}
The documentation says "Each filter and query can accept a _name
in its top level definition." But based on what I observe, this doesn't seem to be the case. What are the rules for how named queries actually need to work?