1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package elastic
import "github.com/olivere/elastic/v7"
type BulkReq struct {
Type string `json:"type"`
IndexName string `json:"index_name"`
DocId string `json:"doc_id"`
RoutingId string `json:"routing_id"`
Doc interface{} `json:"doc"`
}
type BulkIndex struct {
*elastic.BulkIndexRequest
*elastic.BulkDeleteRequest
*elastic.BulkUpdateRequest
}
type UpdateByScriptReq struct {
DocId string `json:"doc_id"`
RoutingId string `json:"routing_id"`
ScriptCtx string `json:"script_ctx"`
IndexName string `json:"index_name"`
}
type GetDocReq struct {
DocId string `json:"doc_id"`
IndexName string `json:"index_name"`
}
type GetCountReq struct {
Condition *elastic.BoolQuery
IndexName string `json:"index_name"`
}
type GetListReq struct {
Condition *elastic.BoolQuery
Page int `json:"page"`
Limit int `json:"limit"`
SearchAfter *SearchAfter `json:"search_after"`
IndexName string `json:"index_name"`
}
type DoSearchServiceReq struct {
SearchService *elastic.SearchService
Page int `json:"page"`
Limit int `json:"limit"`
SearchAfter *SearchAfter `json:"search_after"`
IndexName string `json:"index_name"`
}
type SearchAfter struct {
SortField struct{
Field string `json:"field"`
Sort bool `json:"sort" `
} `json:"sort_field"`
Value int `json:"value"`
}