Skip to content

Commit

Permalink
Merge pull request #112 from quickwit-oss/fmassot/fix-msearch-with-mu…
Browse files Browse the repository at this point in the history
…lti-indexes

Fix msearch with multi indexes.
  • Loading branch information
fmassot authored Mar 28, 2024
2 parents 71272e0 + 287d4c8 commit f685aa0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
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

0 comments on commit f685aa0

Please sign in to comment.