我期待找到每個擴展的總和。 JSON文件包含ElasticSearch每個擴展的查詢獲得其長度的總和
示例代碼
{"index":{"_id":"202"}}
"length":500000
"extension":".jpeg"
輸出想要
重點:JPEG千萬 重點:DOCX 20000000
試過代碼
GET /crud_sample2/Customer_Info/_search?extension
{
"aggs": {
"sum": {
"terms": {
"field": "length"
}
}
}
}
輸出
「鑰匙」:500000 「doc_count」:15
http://stackoverflow.com/questions/39354830/trying-to-upload-json-files-使用命令行錯誤消息彈性搜索 – Nicola