elasticsearch/struct.go

116 lines
2.9 KiB
Go
Raw Permalink Normal View History

2022-03-10 04:01:06 +00:00
package elasticsearch
import "time"
2022-03-10 13:41:44 +00:00
// RequestBody ...
type RequestBody struct {
ApiKey string `json:"apiKey"`
Body []byte `json:"body"`
}
2022-03-10 04:36:06 +00:00
// Response
// response to service es
2022-03-10 04:01:06 +00:00
type Response struct {
2022-03-24 09:48:08 +00:00
Success bool `json:"success"`
Data []byte `json:"data,omitempty"`
Total int64 `json:"total,omitempty"`
Page int64 `json:"page,omitempty"`
Limit int64 `json:"limit,omitempty"`
Message string `json:"message"`
2022-03-10 04:01:06 +00:00
}
2022-03-21 02:19:46 +00:00
// Payload ...
// payload for sync data to service es
type Payload struct {
2022-03-10 04:01:06 +00:00
Index string
Data []byte
}
2022-03-15 08:00:34 +00:00
// DeleteDataPayload
// Payload for delete document
type DeleteDataPayload struct {
Index string
ID string
}
2022-03-10 04:36:06 +00:00
// ESQuery
// Query support to search document
2022-03-10 04:01:06 +00:00
type ESQuery struct {
2022-04-25 02:22:33 +00:00
IsMatch bool // Search with match or prefix
2022-03-10 04:01:06 +00:00
Index string // Index
Page int64
Limit int64
Keyword string
ProvinceCode int
Active string
2022-08-22 02:45:56 +00:00
Display string
ShopID string
2022-03-15 08:00:34 +00:00
IsOutOfStock string
CanIssueInvoice string
PendingInactive string
2022-03-10 04:01:06 +00:00
Categories []string
SubCategories []string
IgnoreIDs []string
Suppliers []string
SlugCites []string
Type string
ServiceDelivery string
SourceDelivery string
2022-03-22 10:09:48 +00:00
Brands []string
NoBrand string
2022-03-10 04:01:06 +00:00
Banned string
ListUser []string
ListNotUser []string
PaymentMethod string
Source string
2022-10-06 10:10:28 +00:00
ListSource []string
2022-03-10 04:01:06 +00:00
FromNewActiveSeller string
2022-03-10 13:41:44 +00:00
FromNewActiveBuyer string
2022-03-10 04:01:06 +00:00
EmailStatus string
MerchantStatus string
IsCalled string
IsAutoApproved string
ProcessStatus string
OutboundRequestStatus string
IsWholesaleBonus string
IsPreorder string
IsDeleted string
Tags []string
Sorts []ESSort
ListStatus []string
ListDeliveryStatus []string
FromAt time.Time
ToAt time.Time
ApprovedFrom time.Time
ApprovedTo time.Time
DeliveredFrom time.Time
DeliveredTo time.Time
CashbackFrom time.Time
CashbackTo time.Time
FromPrice float64
ToPrice float64
Inventories []string
NotInventories []string
ReferralCode string
MembershipLevel int
Invitee string
Segments []string
2022-04-27 04:16:03 +00:00
IsOrderMerchant bool
2022-04-28 03:59:43 +00:00
ImportHistory string
IsSetup string
2022-05-11 06:54:47 +00:00
IsAvailable string
2022-09-26 10:37:14 +00:00
PlatForm string
2022-09-27 05:17:18 +00:00
BusinessType string
2022-10-06 09:43:57 +00:00
ServiceEcommerce []string
2022-09-29 04:48:43 +00:00
Status string
2022-03-10 04:01:06 +00:00
}
2022-03-10 04:36:06 +00:00
// ESSort
// ES sort with field
// ... filed is sort
// ... ascending [true is asc] [false is desc]
2022-03-10 04:01:06 +00:00
type ESSort struct {
2022-03-10 04:36:06 +00:00
Field string // Filed sort
2022-03-10 04:01:06 +00:00
Ascending bool
}