mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 00:37:04 -06:00
Elasticsearch: Use array of strings as index in backend queries (#67276)
Elasticsearch: Use array of strings as indice in backend queries
This commit is contained in:
parent
a420040c73
commit
d0ced39847
@ -207,7 +207,7 @@ func (c *baseClientImpl) createMultiSearchRequests(searchRequests []*SearchReque
|
||||
header: map[string]interface{}{
|
||||
"search_type": "query_then_fetch",
|
||||
"ignore_unavailable": true,
|
||||
"index": strings.Join(c.indices, ","),
|
||||
"index": c.indices,
|
||||
},
|
||||
body: searchReq,
|
||||
interval: searchReq.Interval,
|
||||
|
@ -96,7 +96,7 @@ func TestClient_ExecuteMultisearch(t *testing.T) {
|
||||
jBody, err := simplejson.NewJson(bodyBytes)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "metrics-2018.05.15", jHeader.Get("index").MustString())
|
||||
assert.Equal(t, []string{"metrics-2018.05.15"}, jHeader.Get("index").MustStringArray())
|
||||
assert.True(t, jHeader.Get("ignore_unavailable").MustBool(false))
|
||||
assert.Equal(t, "query_then_fetch", jHeader.Get("search_type").MustString())
|
||||
assert.Empty(t, jHeader.Get("max_concurrent_shard_requests"))
|
||||
|
@ -82,7 +82,7 @@ func TestRequestSnapshots(t *testing.T) {
|
||||
queryHeader := []byte(`
|
||||
{
|
||||
"ignore_unavailable": true,
|
||||
"index": "testdb-2022.11.14",
|
||||
"index": ["testdb-2022.11.14"],
|
||||
"search_type": "query_then_fetch"
|
||||
}
|
||||
`)
|
||||
|
Loading…
Reference in New Issue
Block a user