From abf672c9bee3eef0d7133267d704e628d51688fb Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Wed, 20 Jul 2022 15:10:15 -0700 Subject: [PATCH] Fixing paths for some APIs (#134) Signed-off-by: Vacha Shah --- opensearchapi/api.create.go | 4 ++-- opensearchapi/api.exists_source.go | 4 ++-- opensearchapi/api.explain.go | 4 ++-- opensearchapi/api.get_source.go | 4 ++-- opensearchapi/api.termvectors.go | 4 ++-- opensearchapi/api.update.go | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/opensearchapi/api.create.go b/opensearchapi/api.create.go index c3bee7351..c247307bc 100644 --- a/opensearchapi/api.create.go +++ b/opensearchapi/api.create.go @@ -95,9 +95,9 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, path.WriteString("/") path.WriteString(r.Index) path.WriteString("/") - path.WriteString(r.DocumentID) - path.WriteString("/") path.WriteString("_create") + path.WriteString("/") + path.WriteString(r.DocumentID) params = make(map[string]string) diff --git a/opensearchapi/api.exists_source.go b/opensearchapi/api.exists_source.go index a730af3c0..d154faf0e 100644 --- a/opensearchapi/api.exists_source.go +++ b/opensearchapi/api.exists_source.go @@ -91,9 +91,9 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp path.WriteString("/") path.WriteString(r.Index) path.WriteString("/") - path.WriteString(r.DocumentID) - path.WriteString("/") path.WriteString("_source") + path.WriteString("/") + path.WriteString(r.DocumentID) params = make(map[string]string) diff --git a/opensearchapi/api.explain.go b/opensearchapi/api.explain.go index 2062da5a5..ea80deaa7 100644 --- a/opensearchapi/api.explain.go +++ b/opensearchapi/api.explain.go @@ -97,9 +97,9 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, path.WriteString("/") path.WriteString(r.Index) path.WriteString("/") - path.WriteString(r.DocumentID) - path.WriteString("/") path.WriteString("_explain") + path.WriteString("/") + path.WriteString(r.DocumentID) params = make(map[string]string) diff --git a/opensearchapi/api.get_source.go b/opensearchapi/api.get_source.go index 54d51ffb7..9a7dc1215 100644 --- a/opensearchapi/api.get_source.go +++ b/opensearchapi/api.get_source.go @@ -91,9 +91,9 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons path.WriteString("/") path.WriteString(r.Index) path.WriteString("/") - path.WriteString(r.DocumentID) - path.WriteString("/") path.WriteString("_source") + path.WriteString("/") + path.WriteString(r.DocumentID) params = make(map[string]string) diff --git a/opensearchapi/api.termvectors.go b/opensearchapi/api.termvectors.go index 41d998177..7b1fefdbc 100644 --- a/opensearchapi/api.termvectors.go +++ b/opensearchapi/api.termvectors.go @@ -95,12 +95,12 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo path.Grow(1 + len(r.Index) + 1 + len(r.DocumentID) + 1 + len("_termvectors")) path.WriteString("/") path.WriteString(r.Index) + path.WriteString("/") + path.WriteString("_termvectors") if r.DocumentID != "" { path.WriteString("/") path.WriteString(r.DocumentID) } - path.WriteString("/") - path.WriteString("_termvectors") params = make(map[string]string) diff --git a/opensearchapi/api.update.go b/opensearchapi/api.update.go index 17b5ee3f3..59263fb20 100644 --- a/opensearchapi/api.update.go +++ b/opensearchapi/api.update.go @@ -98,9 +98,9 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, path.WriteString("/") path.WriteString(r.Index) path.WriteString("/") - path.WriteString(r.DocumentID) - path.WriteString("/") path.WriteString("_update") + path.WriteString("/") + path.WriteString(r.DocumentID) params = make(map[string]string)