Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix msearch with multi indexes. #112

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/quickwit/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (c *baseClientImpl) createMultiSearchRequests(searchRequests []*SearchReque
mr := multiRequest{
header: map[string]interface{}{
"ignore_unavailable": true,
"index": c.index,
"index": strings.Split(c.index, ","),
},
body: searchReq,
interval: searchReq.Interval,
Expand Down
2 changes: 1 addition & 1 deletion pkg/quickwit/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestClient_ExecuteMultisearch(t *testing.T) {
jBody, err := simplejson.NewJson(bodyBytes)
require.NoError(t, err)

assert.Equal(t, "my-index", jHeader.Get("index").MustString())
assert.Equal(t, "my-index", jHeader.Get("index").MustStringArray()[0])
assert.True(t, jHeader.Get("ignore_unavailable").MustBool(false))
assert.Empty(t, jHeader.Get("max_concurrent_shard_requests"))
assert.False(t, jHeader.Get("ignore_throttled").MustBool())
Expand Down
2 changes: 1 addition & 1 deletion pkg/quickwit/client/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// SearchRequest represents a search request
type SearchRequest struct {
Index string
Index []string
Interval time.Duration
Size int
Sort []map[string]map[string]interface{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/quickwit/client/search_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewSearchRequestBuilder(interval time.Duration) *SearchRequestBuilder {
// Build builds and return a search request
func (b *SearchRequestBuilder) Build() (*SearchRequest, error) {
sr := SearchRequest{
Index: b.index,
Index: strings.Split(b.index, ","),
Interval: b.interval,
Size: b.size,
Sort: b.sort,
Expand Down
Loading