2022-03-19 04:59:43 +00:00
|
|
|
package elasticsearch
|
|
|
|
|
|
|
|
// Request ...
|
|
|
|
type Request struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// ProductSearch ...
|
2022-03-19 06:33:06 +00:00
|
|
|
func (Request) ProductSearch(query ESQuery) (*Response, error) {
|
2022-03-19 06:12:59 +00:00
|
|
|
return requestNats(SubjectRequestProductSearch, toBytes(query))
|
2022-03-19 04:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ProductUpsert ...
|
2022-03-21 02:19:46 +00:00
|
|
|
func (Request) ProductUpsert(payload Payload) (*Response, error) {
|
|
|
|
return requestNats(SubjectRequestProductUpsert, toBytes(payload))
|
2022-03-19 04:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// UserSearch ...
|
2022-03-19 06:33:06 +00:00
|
|
|
func (Request) UserSearch(query ESQuery) (*Response, error) {
|
2022-03-19 06:12:59 +00:00
|
|
|
return requestNats(SubjectRequestUserSearch, toBytes(query))
|
2022-03-19 04:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// UserUpsert ...
|
2022-03-21 02:19:46 +00:00
|
|
|
func (Request) UserUpsert(payload Payload) (*Response, error) {
|
|
|
|
return requestNats(SubjectRequestUserUpsert, toBytes(payload))
|
2022-03-19 04:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// OrderSearch ...
|
2022-03-19 06:33:06 +00:00
|
|
|
func (Request) OrderSearch(query ESQuery) (*Response, error) {
|
2022-03-19 06:12:59 +00:00
|
|
|
return requestNats(SubjectRequestOrderSearch, toBytes(query))
|
2022-03-19 04:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// OrderUpsert ...
|
2022-03-21 02:19:46 +00:00
|
|
|
func (Request) OrderUpsert(payload Payload) (*Response, error) {
|
|
|
|
return requestNats(SubjectRequestOrderUpsert, toBytes(payload))
|
2022-03-19 04:59:43 +00:00
|
|
|
}
|
2022-03-24 03:26:23 +00:00
|
|
|
|
|
|
|
// KeywordSearch ...
|
|
|
|
func (Request) KeywordSearch(query ESQuery) (*Response, error) {
|
|
|
|
return requestNats(SubjectRequestKeywordSearch, toBytes(query))
|
|
|
|
}
|
|
|
|
|
|
|
|
// KeywordUpsert ...
|
|
|
|
func (Request) KeywordUpsert(payload Payload) (*Response, error) {
|
|
|
|
return requestNats(SubjectRequestKeywordUpsert, toBytes(payload))
|
|
|
|
}
|