Answer the question
In order to leave comments, you need to log in
How to get the number of documents excluded by the filter in elasticsearch?
Hello.
I make a selection with three nested aggregations: by application type, by date, by its version ..
Moreover, detailed data is needed only for the most used versions (they are known in advance)
A selection of this type:
{
"size": 0,
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"app_type": "client"
}
},
{
"terms": {
"app_version": [
"32.1",
"32.2",
"32.3"
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"app_type": "server"
}
},
{
"terms": {
"app_version": [
"1",
"2",
"3"
]
}
}
]
}
}
]
}
},
"aggs": {
"apps": {
"aggs": {
"days": {
"aggs": {
"app_versions": {
"terms": {
"field": "app_version"
}
}
},
"terms": {
"field": "day",
"order": {
"_key": "desc"
}
}
}
},
"terms": {
"field": "app_type"
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question