0
我需要在一個請求中獲取幾個字段的不同值。Elasticsearch _msearch不適用於聚合
當我試圖讓不同的值,一個領域,一切都完美的作品:
GET shakespeare/_search
{
"size": 0,
"aggs": {
"NAME": {
"terms": {
"field": "speaker",
"size": 1000
}
}
}
}
當我打電話與_msearch幾個查詢,一切也適用:
GET shakespeare/_msearch
{}
{"query" : {"match_all" : {}}, "size":2, "from":10}
{}
{"query" : {"match_all" : {}}, "size":2}
但是一旦當我嘗試合併它時,它失敗:
GET shakespeare/_msearch
{}
{
"size": 0,
"aggs": {
"NAME": {
"terms": {
"field": "speaker",
"size": 1000
}
}
}
}
{}
{"query" : {"match_all" : {}}, "size":2}
我得到的錯誤如下:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "Exception when parsing search request"
}
],
"type": "parse_exception",
"reason": "Exception when parsing search request",
"caused_by": {
"type": "json_parse_exception",
"reason": "Unexpected end-of-input within/between Object entries\n at [Source: [email protected]; line: 1, column: 23]"
}
},
"status": 400
}
我做錯了嗎?我應該以某種方式在查詢中包裝aggs嗎?
有沒有其他方法可以做到這一點?
任何幫助表示讚賞!謝謝:)
謝謝!!!這解決了這個問題 – Katerina