Skip to content

Commit 5d20c79

Browse files
committed
Fix routing and tidy up
This commit fixes the `routing` parameter for Multi Get API and More Like This API. Furthermore, we tidied up and updated Go dependencies. Close olivere#1266 Close olivere#1282
1 parent 78fd48a commit 5d20c79

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Diff for: go.mod

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ module github.com/olivere/elastic/v7
33
go 1.13
44

55
require (
6-
github.com/aws/aws-sdk-go v1.27.0
6+
github.com/aws/aws-sdk-go v1.28.12
7+
github.com/davecgh/go-spew v1.1.1 // indirect
78
github.com/fortytw2/leaktest v1.3.0
8-
github.com/golang/mock v1.2.0 // indirect
9-
github.com/google/go-cmp v0.3.1
9+
github.com/google/go-cmp v0.4.0
10+
github.com/kr/pretty v0.2.0 // indirect
1011
github.com/mailru/easyjson v0.7.0
12+
github.com/olivere/elastic v6.2.27+incompatible
1113
github.com/opentracing/opentracing-go v1.1.0
12-
github.com/pkg/errors v0.8.1
14+
github.com/pkg/errors v0.9.1
1315
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9
14-
go.opencensus.io v0.22.2
15-
google.golang.org/api v0.3.1 // indirect
16+
github.com/smartystreets/gunit v1.1.3 // indirect
17+
go.opencensus.io v0.22.3
1618
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
1719
)

Diff for: mget.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func (item *MultiGetItem) Source() (interface{}, error) {
291291
source["_source"] = src
292292
}
293293
if item.routing != "" {
294-
source["_routing"] = item.routing
294+
source["routing"] = item.routing
295295
}
296296
if len(item.storedFields) > 0 {
297297
source["stored_fields"] = strings.Join(item.storedFields, ",")

Diff for: recipes/go.mod

Whitespace-only changes.

Diff for: search_queries_more_like_this.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ func (item *MoreLikeThisQueryItem) Source() (interface{}, error) {
394394
source["fields"] = item.fields
395395
}
396396
if item.routing != "" {
397-
source["_routing"] = item.routing
397+
source["routing"] = item.routing
398398
}
399399
if item.fsc != nil {
400400
src, err := item.fsc.Source()

Diff for: search_queries_more_like_this_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestMoreLikeThisQuerySourceWithLikeAndUnlikeItems(t *testing.T) {
4343
t.Fatal(err)
4444
}
4545
got := string(data)
46-
expected := `{"more_like_this":{"like":[{"_id":"1"},{"_id":"2","_index":"elastic-test2","_routing":"routing_id","_type":"comment"}],"unlike":[{"_id":"3"}]}}`
46+
expected := `{"more_like_this":{"like":[{"_id":"1"},{"_id":"2","_index":"elastic-test2","_type":"comment","routing":"routing_id"}],"unlike":[{"_id":"3"}]}}`
4747
if got != expected {
4848
t.Fatalf("expected\n%s\n,got:\n%s", expected, got)
4949
}

0 commit comments

Comments
 (0)