Merge pull request #6 from Selly-Modules/v1

[Add] Create index
This commit is contained in:
trunglt251292 2022-03-25 10:02:10 +07:00 committed by GitHub
commit d8cb5a1cfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,8 @@ const (
SubjectRequestKeywordUpsert = "selly.request.keyword.upsert" SubjectRequestKeywordUpsert = "selly.request.keyword.upsert"
SubjectPullKeywordUpsert = "selly.pull.keyword.upsert" SubjectPullKeywordUpsert = "selly.pull.keyword.upsert"
SubjectRequestKeywordSearch = "selly.request.keyword.search" SubjectRequestKeywordSearch = "selly.request.keyword.search"
SubjectRequestCreateIndex = "selly.request.es.create_index"
) )
const ( const (

View File

@ -43,3 +43,8 @@ func (Request) KeywordSearch(query ESQuery) (*Response, error) {
func (Request) KeywordUpsert(payload Payload) (*Response, error) { func (Request) KeywordUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestKeywordUpsert, toBytes(payload)) return requestNats(SubjectRequestKeywordUpsert, toBytes(payload))
} }
// CreateIndex ...
func (Request) CreateIndex(payload Payload) (*Response, error) {
return requestNats(SubjectRequestCreateIndex, toBytes(payload))
}