From 4e39cd386106e23a2e3ebc4da25829282fa87c97 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Fri, 25 Mar 2022 09:59:45 +0700 Subject: [PATCH] [Add] Create index --- constants.go | 2 ++ request.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/constants.go b/constants.go index 3239e26..67631fd 100644 --- a/constants.go +++ b/constants.go @@ -16,6 +16,8 @@ const ( SubjectRequestKeywordUpsert = "selly.request.keyword.upsert" SubjectPullKeywordUpsert = "selly.pull.keyword.upsert" SubjectRequestKeywordSearch = "selly.request.keyword.search" + + SubjectRequestCreateIndex = "selly.request.es.create_index" ) const ( diff --git a/request.go b/request.go index 743cf1a..2a7e4bd 100644 --- a/request.go +++ b/request.go @@ -43,3 +43,8 @@ func (Request) KeywordSearch(query ESQuery) (*Response, error) { func (Request) KeywordUpsert(payload Payload) (*Response, error) { return requestNats(SubjectRequestKeywordUpsert, toBytes(payload)) } + +// CreateIndex ... +func (Request) CreateIndex(payload Payload) (*Response, error) { + return requestNats(SubjectRequestCreateIndex, toBytes(payload)) +}