filter - Nested Aggregation Elasticsearch -
i'm trying build nested aggregation in elasticsearch keeps giving errors. says "cannot find agg type tags". how can fix it. thank helps.btw don't have nested documents have 1 document having 180 fields. can apply aggregation? here code:
{ "aggs": { "comments": { "nested": { "path": "comments" }, "aggs" : { "red_products": { "filter": { "not": { "terms": { "text": [ "06melihgokcek", "t.co","??","????","???" ] } } }, "aggs": { "top_docs": { "terms": { "field": "text", "size": 50 } }, "aggs" : { "tags" : { "terms" : { "field" : "text", "include" : ".*avni.*", "exclude" : "fuat_.*" } } } } } } }}}
your innermost aggs
(the 1 called tags
@ bottom) misplaced , should child element of top_docs
.
{ "aggs": { "comments": { "nested": { "path": "comments" }, "aggs": { "red_products": { "filter": { "not": { "terms": { "text": [ "06melihgokcek", "t.co", "??", "????", "???" ] } } }, "aggs": { "top_docs": { "terms": { "field": "text", "size": 50 }, "aggs": { <---- misplaced aggs "tags": { "terms": { "field": "text", "include": ".*avni.*", "exclude": "fuat_.*" } } } } } } } } } }
Comments
Post a Comment