Я получаю пустые сегменты из вложенной агрегации.Я ожидаю получить результат всех ключей и вложенных сегментов с их значениями, но независимо от того, как я их нарежу, я всегда получаю пустой набор результатов блока.с использованием упругого v6.2.4 ее шаги для воспроизведения:
PUT aggregation_test
{"settings": {"number_of_shards": 1}}
PUT aggregation_test/_mapping/doc
{
"properties": {
"Description": {
"type": "text"
},
"string_attributes": {
"type": "nested",
"properties": {
"key": {"type": "text"},
"value": {"type": "text"}
}
}
}
}
Затем заполните данными
POST aggregation_test/doc/1
{
"Description": "one",
"string_attributes": [
{ "key": "Variant", "value": "Red"},
{ "key": "Variant", "value": "Yellow"},
{ "key": "Variant", "value": "Blue"},
{ "key": "EcoFriendly", "value": "Yes"}
]
}
POST aggregation_test/doc/2
{
"Description": "two",
"string_attributes": [
{ "key": "Variant", "value": "Red"},
{ "key": "Variant", "value": "Green"},
{ "key": "Variant", "value": "Blue"},
{ "key": "EcoFriendly", "value": "No"}
]
}
POST aggregation_test/doc/3
{
"Description": "three",
"string_attributes": [
{"key": "Variant", "value": "Red"},
{"key": "Variant", "value": "Green"},
{"key": "Variant", "value": "Blue"}
]
}
Вот моя агрегация
GET aggregation_test/_search
{
"size": 0,
"aggs": {
"nested_level": {
"nested": {
"path": "string_attributes"
},
"aggs": {
"keyword_field": {
"terms": {
"field": "string_attributes.key.keyword"
}, "aggs": {
"value_field": {
"terms": {"field": "string_attributes.value.keyword"}
}
}
}
}
}
}
}
и результат
{
"hits": {
"total": 3,
"max_score": 0,
"hits": []
},
"aggregations": {
"nested_level": {
"doc_count": 11,
"keyword_field": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
}
}
}
}
Есть идеи, почему я не вижу никакой информации о ведре?