From e4e56c4a0d7932e98ac138701c929052133e33be Mon Sep 17 00:00:00 2001 From: medcl Date: Thu, 14 May 2020 14:47:23 +0800 Subject: [PATCH] fix routing breaking change between versions --- bulk.go | 2 +- domain.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bulk.go b/bulk.go index f2eef41..f6d8500 100644 --- a/bulk.go +++ b/bulk.go @@ -103,7 +103,7 @@ READ_DOCS: //fmt.Println(doc.Index,",",doc.Type,",",doc.Id) - // add doc "_routing" + // add doc "_routing" if exists if _, ok := docI["_routing"]; ok { str, ok := docI["_routing"].(string) if ok && str != "" { diff --git a/domain.go b/domain.go index 8f9d422..6f8e912 100644 --- a/domain.go +++ b/domain.go @@ -25,7 +25,7 @@ type Document struct { Type string `json:"_type,omitempty"` Id string `json:"_id,omitempty"` source map[string]interface{} `json:"_source,omitempty"` - Routing string `json:"_routing,omitempty"` + Routing string `json:"routing,omitempty"` //after 6, only `routing` was supported } type Scroll struct {