summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/indices_create.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/indices_create.go')
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/indices_create.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/indices_create.go b/vendor/gopkg.in/olivere/elastic.v5/indices_create.go
index dfd17ac09..8d8e0c25e 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/indices_create.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/indices_create.go
@@ -9,12 +9,12 @@ import (
"errors"
"net/url"
- "gopkg.in/olivere/elastic.v5/uritemplates"
+ "github.com/olivere/elastic/uritemplates"
)
// IndicesCreateService creates a new index.
//
-// See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-create-index.html
+// See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-create-index.html
// for details.
type IndicesCreateService struct {
client *Client
@@ -91,7 +91,7 @@ func (b *IndicesCreateService) Do(ctx context.Context) (*IndicesCreateResult, er
params := make(url.Values)
if b.pretty {
- params.Set("pretty", "1")
+ params.Set("pretty", "true")
}
if b.masterTimeout != "" {
params.Set("master_timeout", b.masterTimeout)
@@ -109,7 +109,12 @@ func (b *IndicesCreateService) Do(ctx context.Context) (*IndicesCreateResult, er
}
// Get response
- res, err := b.client.PerformRequest(ctx, "PUT", path, params, body)
+ res, err := b.client.PerformRequest(ctx, PerformRequestOptions{
+ Method: "PUT",
+ Path: path,
+ Params: params,
+ Body: body,
+ })
if err != nil {
return nil, err
}
@@ -125,6 +130,7 @@ func (b *IndicesCreateService) Do(ctx context.Context) (*IndicesCreateResult, er
// IndicesCreateResult is the outcome of creating a new index.
type IndicesCreateResult struct {
- Acknowledged bool `json:"acknowledged"`
- ShardsAcknowledged bool `json:"shards_acknowledged"`
+ Acknowledged bool `json:"acknowledged"`
+ ShardsAcknowledged bool `json:"shards_acknowledged"`
+ Index string `json:"index,omitempty"`
}