Documentation ¶
Index ¶
- func Int64ArrToInterfaceArray(a []int64) []interface{}
- func MakeBulkESRequest(es *elastic.Client, bulkSize, limit int, reqGap time.Duration, ...) (int, error)
- func MakeBulkESRequestIgnoreConflict(es *elastic.Client, bulkSize, limit int, reqGap time.Duration, ...) (int, error)
- func MakeRequest(es *elastic.Client, bulkSize int, makeSingleRequest SingleReqMaker) (successCount int, err error)
- func MakeRequestWithOpt(es *elastic.Client, bulkSize int, opt BulkOpt, ...) (successCount int, err error)
- func ParseBulkResponse(resp *elastic.BulkResponse) (int, error)
- func ParseBulkResponseIgnoreConflict(resp *elastic.BulkResponse) (int, error)
- func ParseBulkResponseIgnoreDocMiss(resp *elastic.BulkResponse) (int, error)
- func SearchWithExport(makeService func() *elastic.SearchService, export bool) (*elastic.SearchResult, error)
- func StrArrToInterfaceArray(a []string) []interface{}
- type BulkOpt
- type SingleReqMaker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int64ArrToInterfaceArray ¶
func Int64ArrToInterfaceArray(a []int64) []interface{}
func MakeBulkESRequest ¶
func MakeBulkESRequest(es *elastic.Client, bulkSize, limit int, reqGap time.Duration, makeSingleRequest SingleReqMaker) (int, error)
MakeBulkESRequest 分批执行 ES 的批量请求,避免 payload 过大造成集群宕机
bulkSize 最终插入的总数据量, limit 为每批批量插入的数据量, reqGap 为每批插入的时间间隔, makeSingleRequest 应按数据的序号返回对应的每个批量请求的具体内容, 返回成功的数量
func MakeBulkESRequestIgnoreConflict ¶ added in v0.1.1
func MakeBulkESRequestIgnoreConflict(es *elastic.Client, bulkSize, limit int, reqGap time.Duration, makeSingleRequest SingleReqMaker) (int, error)
MakeBulkESRequestIgnoreConflict 分批执行 ES 的批量请求,忽略版本冲突, 避免 payload 过大造成集群宕机
bulkSize 最终插入的总数据量, limit 为每批批量插入的数据量, reqGap 为每批插入的时间间隔, makeSingleRequest 应按数据的序号返回对应的每个批量请求的具体内容, 返回成功的数量
func MakeRequest ¶ added in v0.3.0
func MakeRequest(es *elastic.Client, bulkSize int, makeSingleRequest SingleReqMaker) (successCount int, err error)
MakeRequest 分批执行 ES 的批量请求,避免 payload 过大造成集群宕机,每批 1k, 间隔 1s
func MakeRequestWithOpt ¶ added in v0.3.0
func MakeRequestWithOpt(es *elastic.Client, bulkSize int, opt BulkOpt, makeSingleRequest SingleReqMaker) (successCount int, err error)
func ParseBulkResponse ¶
func ParseBulkResponseIgnoreConflict ¶ added in v0.1.1
func ParseBulkResponseIgnoreDocMiss ¶ added in v0.3.3
func SearchWithExport ¶ added in v0.3.1
func StrArrToInterfaceArray ¶
func StrArrToInterfaceArray(a []string) []interface{}
Types ¶
type SingleReqMaker ¶ added in v0.3.0
type SingleReqMaker func(int) elastic.BulkableRequest
Click to show internal directories.
Click to hide internal directories.