Hi,
I have problem with aggregation, which return no bucket.
(it's more complicated I did drop useless stuff for this example, thats why it's competence inside competence without any other field)
my mapping:
{
"mappings": {
"competence": {
"properties": {
"competence": {
"type": "nested",
"properties": {
"type": {
"type": "nested",
"properties": {
"name": {
"type": "keyword"
},
"value": {
"type": "integer"
}
}
}
}
}
}
}
}
}
typical record looks like this:
{
"_source": {
"competence": {
"type": {
"value": 4,
"name": "TYPE_4"
}
}
}
}
but when I run query:
{
"size": 0,
"aggs": {
"nested_type": {
"nested": {
"path": "competence"
},
"aggs": {
"cmp_type": {
"terms": {
"field": "type.value"
}
}
}
}
},
"query": {
"match_all": {}
}
}
but it will return no bucket
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 26254,
"max_score": 0,
"hits": []
},
"aggregations": {
"nested_type": {
"doc_count": 26254,
"cmp_type": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
}
}
}
}