Skip to content

Commit e4e56c4

Browse files
committed
fix routing breaking change between versions
1 parent 1cfd91b commit e4e56c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bulk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ READ_DOCS:
103103

104104
//fmt.Println(doc.Index,",",doc.Type,",",doc.Id)
105105

106-
// add doc "_routing"
106+
// add doc "_routing" if exists
107107
if _, ok := docI["_routing"]; ok {
108108
str, ok := docI["_routing"].(string)
109109
if ok && str != "" {

domain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Document struct {
2525
Type string `json:"_type,omitempty"`
2626
Id string `json:"_id,omitempty"`
2727
source map[string]interface{} `json:"_source,omitempty"`
28-
Routing string `json:"_routing,omitempty"`
28+
Routing string `json:"routing,omitempty"` //after 6, only `routing` was supported
2929
}
3030

3131
type Scroll struct {

0 commit comments

Comments
 (0)