Open almondyoung opened 1 year ago
request like :
{
"size": 0,
"aggs": {
"categories": {
"terms": {
"field": "category"
}
}
}
}
response like:
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 14
},
"max_score": 1,
"hits": []
},
"aggregations": {
"categories": {
"buckets": [
{
"doc_count": 8,
"key": "xx"
},
{
"doc_count": 2,
"key": "xxx"
},
{
"doc_count": 2,
"key": "xxxx"
},
{
"doc_count": 1,
"key": "xxxxx"
},
{
"doc_count": 1,
"key": "xxxxxx"
}
]
}
}
}
Suggest use https://github.com/elastic/go-elasticsearch v7, this SDK is not good.
Suggest use https://github.com/elastic/go-elasticsearch v7, this SDK is not good.
Can go-elasticsearch request zinc directly without huge modification?
cannot unmarshal array into Go struct field MetaAggregationResponse.aggregations.buckets of type map[string]interface {}
buckets not support slice