summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/update.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/update.go')
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/update.go26
1 files changed, 9 insertions, 17 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/update.go b/vendor/gopkg.in/olivere/elastic.v5/update.go
index 5507fae4c..1718bc585 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"
- "github.com/olivere/elastic/uritemplates"
+ "gopkg.in/olivere/elastic.v5/uritemplates"
)
// UpdateService updates a document in Elasticsearch.
-// See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update.html
+// See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/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 e.g. "internal".
+// VersionType is one of "internal" or "force".
func (b *UpdateService) VersionType(versionType string) *UpdateService {
b.versionType = versionType
return b
@@ -293,12 +293,7 @@ func (b *UpdateService) Do(ctx context.Context) (*UpdateResponse, error) {
}
// Get response
- res, err := b.client.PerformRequest(ctx, PerformRequestOptions{
- Method: "POST",
- Path: path,
- Params: params,
- Body: body,
- })
+ res, err := b.client.PerformRequest(ctx, "POST", path, params, body)
if err != nil {
return nil, err
}
@@ -313,15 +308,12 @@ 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,omitempty"`
- Type string `json:"_type,omitempty"`
- Id string `json:"_id,omitempty"`
- Version int64 `json:"_version,omitempty"`
+ Index string `json:"_index"`
+ Type string `json:"_type"`
+ Id string `json:"_id"`
+ Version int `json:"_version"`
+ Shards *shardsInfo `json:"_shards"`
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"`
}