diff options
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/update.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/update.go | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/update.go b/vendor/gopkg.in/olivere/elastic.v5/update.go index 1718bc585..5507fae4c 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/update.go +++ b/vendor/gopkg.in/olivere/elastic.v5/update.go @@ -10,11 +10,11 @@ import ( "net/url" "strings" - "gopkg.in/olivere/elastic.v5/uritemplates" + "github.com/olivere/elastic/uritemplates" ) // UpdateService updates a document in Elasticsearch. -// See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update.html +// See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update.html // for details. type UpdateService struct { client *Client @@ -105,7 +105,7 @@ func (b *UpdateService) Version(version int64) *UpdateService { return b } -// VersionType is one of "internal" or "force". +// VersionType is e.g. "internal". func (b *UpdateService) VersionType(versionType string) *UpdateService { b.versionType = versionType return b @@ -293,7 +293,12 @@ func (b *UpdateService) Do(ctx context.Context) (*UpdateResponse, error) { } // Get response - res, err := b.client.PerformRequest(ctx, "POST", path, params, body) + res, err := b.client.PerformRequest(ctx, PerformRequestOptions{ + Method: "POST", + Path: path, + Params: params, + Body: body, + }) if err != nil { return nil, err } @@ -308,12 +313,15 @@ func (b *UpdateService) Do(ctx context.Context) (*UpdateResponse, error) { // UpdateResponse is the result of updating a document in Elasticsearch. type UpdateResponse struct { - Index string `json:"_index"` - Type string `json:"_type"` - Id string `json:"_id"` - Version int `json:"_version"` - Shards *shardsInfo `json:"_shards"` + Index string `json:"_index,omitempty"` + Type string `json:"_type,omitempty"` + Id string `json:"_id,omitempty"` + Version int64 `json:"_version,omitempty"` Result string `json:"result,omitempty"` + Shards *shardsInfo `json:"_shards,omitempty"` + SeqNo int64 `json:"_seq_no,omitempty"` + PrimaryTerm int64 `json:"_primary_term,omitempty"` + Status int `json:"status,omitempty"` ForcedRefresh bool `json:"forced_refresh,omitempty"` GetResult *GetResult `json:"get,omitempty"` } |