es

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustBulkRequestBody added in v1.1.0

func AdjustBulkRequestBody(requestBody []byte, responseBody map[string]interface{}, reservationType DocTypeReservationType) ([]byte, error)

func AdjustBulkRequestBodyWithOnlyDocType added in v1.1.0

func AdjustBulkRequestBodyWithOnlyDocType(requestBody []byte, reservationType DocTypeReservationType) ([]byte, error)

func ClusterVersionGte7 added in v1.1.6

func ClusterVersionGte7(clusterVersion string) bool

func ClusterVersionLte5 added in v1.1.6

func ClusterVersionLte5(clusterVersion string) bool

Types

type BaseES added in v1.1.0

type BaseES struct {
	ClusterVersion string
	Addresses      []string
	User           string
	Password       string

	ActionRuleMap map[RequestActionType]*UriParserRule
	MethodRuleMap map[MethodType][]*MatchRule

	Settings IESSettings
}

func NewBaseES added in v1.1.0

func NewBaseES(clusterVersion string, addresses []string, user string, password string) *BaseES

func (*BaseES) GetActionRuleMap added in v1.1.0

func (es *BaseES) GetActionRuleMap() map[RequestActionType]*UriParserRule

func (*BaseES) GetAddresses added in v1.1.0

func (es *BaseES) GetAddresses() []string

func (*BaseES) GetMethodRuleMap added in v1.1.0

func (es *BaseES) GetMethodRuleMap() map[MethodType][]*MatchRule

func (*BaseES) GetPassword added in v1.1.0

func (es *BaseES) GetPassword() string

func (*BaseES) GetSearchResponse added in v1.1.0

func (es *BaseES) GetSearchResponse(bodyMap map[string]interface{}) map[string]interface{}

func (*BaseES) GetUser added in v1.1.0

func (es *BaseES) GetUser() string

func (*BaseES) IsWrite added in v1.1.0

func (es *BaseES) IsWrite(requestActionType RequestActionType) bool

func (*BaseES) MakeUri added in v1.1.0

func (es *BaseES) MakeUri(c *gin.Context, uriPathParserResult *UriPathParserResult) (*UriPathMakeResult, error)

func (*BaseES) MatchRule added in v1.1.0

func (es *BaseES) MatchRule(c *gin.Context) *UriPathParserResult

func (*BaseES) Request added in v1.1.0

func (es *BaseES) Request(c *gin.Context, bodyBytes []byte, parserUriResult *UriPathParserResult) (map[string]interface{}, int, error)

type BulkRequestItem added in v1.1.0

type BulkRequestItem struct {
	ActionType string
	Metadata   map[string]interface{}
	Document   map[string]interface{}
}

func (*BulkRequestItem) ToStringArray added in v1.1.0

func (bulkRequestItem *BulkRequestItem) ToStringArray() []string

type BulkResponse added in v1.1.0

type BulkResponse struct {
	Items []map[string]BulkResponseItem `mapstructure:"items"`
}

type BulkResponseItem added in v1.1.0

type BulkResponseItem struct {
	Id     string `mapstructure:"_id"`
	Status int    `mapstructure:"status"`
}

type ClusterHealthRespV5 added in v1.1.0

type ClusterHealthRespV5 struct {
	ActivePrimaryShards         int     `json:"active_primary_shards"`
	ActiveShards                int     `json:"active_shards"`
	ActiveShardsPercentAsNumber float64 `json:"active_shards_percent_as_number"`
	ClusterName                 string  `json:"cluster_name"`
	DelayedUnassignedShards     int     `json:"delayed_unassigned_shards"`
	InitializingShards          int     `json:"initializing_shards"`
	NumberOfDataNodes           int     `json:"number_of_data_nodes"`
	NumberOfInFlightFetch       int     `json:"number_of_in_flight_fetch"`
	NumberOfNodes               int     `json:"number_of_nodes"`
	NumberOfPendingTasks        int     `json:"number_of_pending_tasks"`
	RelocatingShards            int     `json:"relocating_shards"`
	Status                      string  `json:"status"`
	TaskMaxWaitingInQueueMillis int     `json:"task_max_waiting_in_queue_millis"`
	TimedOut                    bool    `json:"timed_out"`
	UnassignedShards            int     `json:"unassigned_shards"`
}

type ClusterVersion

type ClusterVersion struct {
	Name        string `json:"name,omitempty"`
	ClusterName string `json:"cluster_name,omitempty"`
	Version     struct {
		Number        string `json:"number,omitempty"`
		LuceneVersion string `json:"lucene_version,omitempty"`
	} `json:"version,omitempty"`
}

type Doc

type Doc struct {
	Type   string                 `mapstructure:"_type" json:"_type"`
	ID     string                 `mapstructure:"_id" json:"_id"`
	Source map[string]interface{} `mapstructure:"_source" json:"_source"`
	Hash   uint64                 `mapstructure:"_hash" json:"_hash"`
	Op     Operation              `mapstructure:"_op" json:"_op"`
}

func FixDoc added in v1.0.30

func FixDoc(ctx context.Context, doc *Doc) (*Doc, error)

func (*Doc) DumpFileBytes added in v1.0.30

func (d *Doc) DumpFileBytes() []byte

type DocTypeReservationType added in v1.1.0

type DocTypeReservationType string
const (
	DocTypeReservationTypeCreate DocTypeReservationType = "add"
	DocTypeReservationTypeKeep   DocTypeReservationType = "keep"
	DocTypeReservationTypeDelete DocTypeReservationType = "delete"
)

type ES

type ES interface {
	GetClusterVersion() string
	IndexExisted(index string) (bool, error)
	GetIndexes() ([]string, error)

	NewScroll(ctx context.Context, index string, option *ScrollOption) (*ScrollResult, error)
	NextScroll(ctx context.Context, scrollId string, scrollTime uint) (*ScrollResult, error)
	ClearScroll(scrollId string) error

	BulkBody(index string, buf *bytes.Buffer, doc *Doc) error
	Bulk(buf *bytes.Buffer) error

	GetIndexMappingAndSetting(index string) (IESSettings, error)

	CreateIndex(esSetting IESSettings) error
	DeleteIndex(index string) error

	Count(ctx context.Context, index string) (uint64, error)

	CreateTemplate(ctx context.Context, name string, body map[string]interface{}) error

	ClusterHealth(ctx context.Context) (map[string]interface{}, error)

	GetInfo(ctx context.Context) (map[string]interface{}, error)

	GetAddresses() []string

	GetUser() string

	GetPassword() string

	MatchRule(c *gin.Context) *UriPathParserResult

	MakeUri(c *gin.Context, uriPathParserResult *UriPathParserResult) (*UriPathMakeResult, error)

	GetSearchResponse(bodyMap map[string]interface{}) map[string]interface{}

	GetActionRuleMap() map[RequestActionType]*UriParserRule

	GetMethodRuleMap() map[MethodType][]*MatchRule

	IsWrite(requestActionType RequestActionType) bool

	Request(c *gin.Context, bodyBytes []byte, parserUriResult *UriPathParserResult) (map[string]interface{}, int, error)
}

type FixUnit added in v1.0.30

type FixUnit struct {
	SourceESVersionRange *version.Constraints
	TargetESVersionRange *version.Constraints
	Actions              []string
	Callback             fixCallback
}

func (*FixUnit) IsMatch added in v1.0.30

func (f *FixUnit) IsMatch(sourceESVersion, targetESVersion *version.Version) bool

type IESSettings

type IESSettings interface {
	ToESV5Setting() map[string]interface{}
	ToESV6Setting() map[string]interface{}
	ToESV7Setting() map[string]interface{}
	ToESV8Setting() map[string]interface{}

	ToESV5Mapping() map[string]interface{}
	ToESV6Mapping() map[string]interface{}
	ToESV7Mapping() map[string]interface{}
	ToESV8Mapping() map[string]interface{}

	ToTargetV5Settings(targetIndex string) *V5Settings
	ToTargetV6Settings(targetIndex string) *V6Settings
	ToTargetV7Settings(targetIndex string) *V7Settings
	ToTargetV8Settings(targetIndex string) *V8Settings

	ToV5TemplateSettings(pattern []string, order int) map[string]interface{}
	ToV6TemplateSettings(pattern []string, order int) map[string]interface{}
	ToV7TemplateSettings(pattern []string, order int) map[string]interface{}
	ToV8TemplateSettings(pattern []string, order int) map[string]interface{}

	GetIndex() string
	GetMappings() map[string]interface{}
	GetSettings() map[string]interface{}
	GetAliases() map[string]interface{}
	GetProperties() map[string]interface{}
	GetFieldMap() map[string]interface{}
}

func GetESSettings added in v1.0.30

func GetESSettings(esVersion string, settings map[string]interface{}) (IESSettings, error)

type IResponse added in v1.0.33

type IResponse interface {
	String() string
	Status() string
}

type MatchRule added in v1.1.0

type MatchRule struct {
	Method     MethodType
	UriPattern string
	Priority   int

	RequestActionType RequestActionType
}

type MethodType added in v1.1.0

type MethodType string
const (
	MethodPost   MethodType = "POST"
	MethodPut    MethodType = "PUT"
	MethodGet    MethodType = "GET"
	MethodDelete MethodType = "DELETE"
)

type Operation

type Operation int
const (
	OperationCreate Operation = iota
	OperationUpdate
	OperationDelete
)

type RequestActionType added in v1.1.0

type RequestActionType string
const (
	RequestActionTypeUpsertDocument       RequestActionType = "upsertDocument"
	RequestActionTypeCreateDocument       RequestActionType = "createDocument"
	RequestActionTypeCreateDocumentWithID RequestActionType = "createDocumentWithID"
	RequestActionTypeDeleteDocument       RequestActionType = "deleteDocument"
	RequestActionTypeUpdateDocument       RequestActionType = "updateDocument"

	RequestActionTypeDeleteByQuery RequestActionType = "deleteByQuery"
	RequestActionTypeUpdateByQuery RequestActionType = "updateByQuery"

	RequestActionTypeBulkDocument RequestActionType = "bulkDocument"

	RequestActionTypeGetDocument             RequestActionType = "getDocument"
	RequestActionTypeGetDocumentOnlySource   RequestActionType = "getDocumentOnlySource"
	RequestActionTypeMGetDocument            RequestActionType = "mgetDocument"
	RequestActionTypeSearchDocument          RequestActionType = "searchDocument"
	RequestActionTypeSearchDocumentWithLimit RequestActionType = "searchDocumentWithLimit"
)

type ScrollOption

type ScrollOption struct {
	Query      map[string]interface{}
	SortFields []string
	ScrollSize uint
	ScrollTime uint
	SliceId    *uint
	SliceSize  *uint
}

type ScrollResult

type ScrollResult struct {
	Total    uint64
	Docs     []*Doc
	ScrollId string
}

type ScrollResultV5

type ScrollResultV5 struct {
	Took     int    `json:"took,omitempty"`
	ScrollId string `json:"_scroll_id,omitempty"`
	TimedOut bool   `json:"timed_out,omitempty"`
	Hits     struct {
		MaxScore float32       `json:"max_score,omitempty"`
		Total    int           `json:"total,omitempty"`
		Docs     []interface{} `json:"hits,omitempty"`
	} `json:"hits"`
	Shards struct {
		Total      int `json:"total,omitempty"`
		Successful int `json:"successful,omitempty"`
		Skipped    int `json:"skipped,omitempty"`
		Failed     int `json:"failed,omitempty"`
		Failures   []struct {
			Shard  int         `json:"shard,omitempty"`
			Index  string      `json:"index,omitempty"`
			Status int         `json:"status,omitempty"`
			Reason interface{} `json:"reason,omitempty"`
		} `json:"failures,omitempty"`
	} `json:"_shards,omitempty"`
}

type ScrollResultV7

type ScrollResultV7 struct {
	Took     int    `json:"took,omitempty"`
	ScrollId string `json:"_scroll_id,omitempty"`
	TimedOut bool   `json:"timed_out,omitempty"`
	Hits     struct {
		MaxScore float32 `json:"max_score,omitempty"`
		Total    struct {
			Value    int    `json:"value,omitempty"`
			Relation string `json:"relation,omitempty"`
		} `json:"total,omitempty"`
		Docs []interface{} `json:"hits,omitempty"`
	} `json:"hits"`
	Shards struct {
		Successful int `json:"successful,omitempty"`
		Skipped    int `json:"skipped,omitempty"`
		Failed     int `json:"failed,omitempty"`
		Failures   []struct {
			Shard  int         `json:"shard,omitempty"`
			Index  string      `json:"index,omitempty"`
			Status int         `json:"status,omitempty"`
			Reason interface{} `json:"reason,omitempty"`
		} `json:"failures,omitempty"`
	} `json:"_shards,omitempty"`
}

type ScrollResultV8

type ScrollResultV8 struct {
	Took     int    `json:"took,omitempty"`
	ScrollId string `json:"_scroll_id,omitempty"`
	TimedOut bool   `json:"timed_out,omitempty"`
	Hits     struct {
		MaxScore *float32 `json:"max_score,omitempty"`
		Total    struct {
			Value    int    `json:"value,omitempty"`
			Relation string `json:"relation,omitempty"`
		} `json:"total,omitempty"`
		Docs []interface{} `json:"hits,omitempty"`
	} `json:"hits"`
	Shards struct {
		Total      int `json:"total,omitempty"`
		Successful int `json:"successful,omitempty"`
		Skipped    int `json:"skipped,omitempty"`
		Failed     int `json:"failed,omitempty"`
		Failures   []struct {
			Shard  int         `json:"shard,omitempty"`
			Index  string      `json:"index,omitempty"`
			Status int         `json:"status,omitempty"`
			Reason interface{} `json:"reason,omitempty"`
		} `json:"failures,omitempty"`
	} `json:"_shards,omitempty"`
}

type UriParserRule added in v1.1.0

type UriParserRule struct {
	MatchRules []*MatchRule
	IsWrite    bool
}

type UriPathMakeResult added in v1.1.0

type UriPathMakeResult struct {
	Uri      string
	Method   MethodType
	Address  string
	User     string
	Password string
}

type UriPathParserResult added in v1.1.0

type UriPathParserResult struct {
	RequestAction RequestActionType
	VariableMap   map[string]string
}

type V0

type V0 struct {
	Config *config.ESConfig
}

func NewESV0

func NewESV0(config *config.ESConfig) *V0

func (*V0) Get

func (es *V0) Get(url string) ([]byte, error)

func (*V0) GetES

func (es *V0) GetES() (ES, error)

func (*V0) GetVersion

func (es *V0) GetVersion() (*ClusterVersion, error)

type V5

type V5 struct {
	*elasticsearch5.Client
	*BaseES
}

func NewESV5

func NewESV5(esConfig *config.ESConfig, clusterVersion string) (*V5, error)

func (*V5) Bulk

func (es *V5) Bulk(buf *bytes.Buffer) error

func (*V5) BulkBody

func (es *V5) BulkBody(index string, buf *bytes.Buffer, doc *Doc) error

func (*V5) ClearScroll

func (es *V5) ClearScroll(scrollId string) error

func (*V5) ClusterHealth added in v1.1.0

func (es *V5) ClusterHealth(ctx context.Context) (map[string]interface{}, error)

func (*V5) Count added in v1.0.16

func (es *V5) Count(ctx context.Context, index string) (uint64, error)

func (*V5) CreateIndex

func (es *V5) CreateIndex(esSetting IESSettings) error

func (*V5) CreateTemplate added in v1.0.34

func (es *V5) CreateTemplate(ctx context.Context, name string, body map[string]interface{}) error

func (*V5) DeleteIndex

func (es *V5) DeleteIndex(index string) error

func (*V5) GetClusterVersion

func (es *V5) GetClusterVersion() string

func (*V5) GetIndexAliases

func (es *V5) GetIndexAliases(index string) (map[string]interface{}, error)

func (*V5) GetIndexMapping

func (es *V5) GetIndexMapping(index string) (map[string]interface{}, error)

func (*V5) GetIndexMappingAndSetting

func (es *V5) GetIndexMappingAndSetting(index string) (IESSettings, error)

func (*V5) GetIndexSettings

func (es *V5) GetIndexSettings(index string) (map[string]interface{}, error)

func (*V5) GetIndexes

func (es *V5) GetIndexes() ([]string, error)

func (*V5) GetInfo added in v1.1.0

func (es *V5) GetInfo(ctx context.Context) (map[string]interface{}, error)

func (*V5) IndexExisted

func (es *V5) IndexExisted(indexName string) (bool, error)

func (*V5) NewScroll

func (es *V5) NewScroll(ctx context.Context, index string, option *ScrollOption) (*ScrollResult, error)

func (*V5) NextScroll

func (es *V5) NextScroll(ctx context.Context, scrollId string, scrollTime uint) (*ScrollResult, error)

func (*V5) ParseRequest added in v1.1.0

func (es *V5) ParseRequest(c *gin.Context)

type V5Settings

type V5Settings struct {
	Settings map[string]interface{}
	Mappings map[string]interface{}
	Aliases  map[string]interface{}

	SourceIndex string
}

func NewV5Settings

func NewV5Settings(settings, mappings, aliases map[string]interface{}, sourceIndex string) *V5Settings

func (*V5Settings) DateFieldSupportTimestamp

func (v5 *V5Settings) DateFieldSupportTimestamp(properties map[string]interface{}) map[string]interface{}

func (*V5Settings) GetAliases

func (v5 *V5Settings) GetAliases() map[string]interface{}

func (*V5Settings) GetFieldMap

func (v5 *V5Settings) GetFieldMap() map[string]interface{}

func (*V5Settings) GetIndex

func (v5 *V5Settings) GetIndex() string

func (*V5Settings) GetMappings

func (v5 *V5Settings) GetMappings() map[string]interface{}

func (*V5Settings) GetProperties

func (v5 *V5Settings) GetProperties() map[string]interface{}

func (*V5Settings) GetSettings

func (v5 *V5Settings) GetSettings() map[string]interface{}

func (*V5Settings) ToAlias

func (v5 *V5Settings) ToAlias() map[string]interface{}

func (*V5Settings) ToESV5Mapping

func (v5 *V5Settings) ToESV5Mapping() map[string]interface{}

func (*V5Settings) ToESV5Setting

func (v5 *V5Settings) ToESV5Setting() map[string]interface{}

func (*V5Settings) ToESV6Mapping

func (v5 *V5Settings) ToESV6Mapping() map[string]interface{}

func (*V5Settings) ToESV6Setting

func (v5 *V5Settings) ToESV6Setting() map[string]interface{}

func (*V5Settings) ToESV7Mapping

func (v5 *V5Settings) ToESV7Mapping() map[string]interface{}

func (*V5Settings) ToESV7Setting

func (v5 *V5Settings) ToESV7Setting() map[string]interface{}

func (*V5Settings) ToESV8Mapping

func (v5 *V5Settings) ToESV8Mapping() map[string]interface{}

func (*V5Settings) ToESV8Setting

func (v5 *V5Settings) ToESV8Setting() map[string]interface{}

func (*V5Settings) ToTargetV5Settings

func (v5 *V5Settings) ToTargetV5Settings(targetIndex string) *V5Settings

func (*V5Settings) ToTargetV6Settings

func (v5 *V5Settings) ToTargetV6Settings(targetIndex string) *V6Settings

func (*V5Settings) ToTargetV7Settings

func (v5 *V5Settings) ToTargetV7Settings(targetIndex string) *V7Settings

func (*V5Settings) ToTargetV8Settings

func (v5 *V5Settings) ToTargetV8Settings(targetIndex string) *V8Settings

func (*V5Settings) ToV5TemplateSettings added in v1.0.34

func (v5 *V5Settings) ToV5TemplateSettings(patterns []string, order int) map[string]interface{}

func (*V5Settings) ToV6TemplateSettings added in v1.0.34

func (v5 *V5Settings) ToV6TemplateSettings(patterns []string, order int) map[string]interface{}

func (*V5Settings) ToV7TemplateSettings added in v1.0.34

func (v5 *V5Settings) ToV7TemplateSettings(patterns []string, order int) map[string]interface{}

func (*V5Settings) ToV8TemplateSettings added in v1.0.34

func (v5 *V5Settings) ToV8TemplateSettings(patterns []string, order int) map[string]interface{}

type V6

type V6 struct {
	*elasticsearch6.Client
	*BaseES
}

func NewESV6

func NewESV6(esConfig *config.ESConfig, clusterVersion string) (*V6, error)

func (*V6) Bulk

func (es *V6) Bulk(buf *bytes.Buffer) error

func (*V6) BulkBody

func (es *V6) BulkBody(index string, buf *bytes.Buffer, doc *Doc) error

func (*V6) ClearScroll

func (es *V6) ClearScroll(scrollId string) error

func (*V6) ClusterHealth added in v1.1.0

func (es *V6) ClusterHealth(ctx context.Context) (map[string]interface{}, error)

func (*V6) Count added in v1.0.16

func (es *V6) Count(ctx context.Context, index string) (uint64, error)

func (*V6) CreateIndex

func (es *V6) CreateIndex(esSetting IESSettings) error

func (*V6) CreateTemplate added in v1.0.34

func (es *V6) CreateTemplate(ctx context.Context, name string, body map[string]interface{}) error

func (*V6) DeleteIndex

func (es *V6) DeleteIndex(index string) error

func (*V6) GetAddresses added in v1.1.0

func (es *V6) GetAddresses() []string

func (*V6) GetClusterVersion

func (es *V6) GetClusterVersion() string

func (*V6) GetIndexAliases

func (es *V6) GetIndexAliases(index string) (map[string]interface{}, error)

func (*V6) GetIndexMapping

func (es *V6) GetIndexMapping(index string) (map[string]interface{}, error)

func (*V6) GetIndexMappingAndSetting

func (es *V6) GetIndexMappingAndSetting(index string) (IESSettings, error)

func (*V6) GetIndexSettings

func (es *V6) GetIndexSettings(index string) (map[string]interface{}, error)

func (*V6) GetIndexes

func (es *V6) GetIndexes() ([]string, error)

func (*V6) GetInfo added in v1.1.0

func (es *V6) GetInfo(ctx context.Context) (map[string]interface{}, error)

func (*V6) GetPassword added in v1.1.0

func (es *V6) GetPassword() string

func (*V6) GetUser added in v1.1.0

func (es *V6) GetUser() string

func (*V6) IndexExisted

func (es *V6) IndexExisted(indexName string) (bool, error)

func (*V6) NewScroll

func (es *V6) NewScroll(ctx context.Context, index string, option *ScrollOption) (*ScrollResult, error)

func (*V6) NextScroll

func (es *V6) NextScroll(ctx context.Context, scrollId string, scrollTime uint) (*ScrollResult, error)

type V6Settings

type V6Settings struct {
	*V5Settings
}

func NewV6Settings

func NewV6Settings(settings, mappings, aliases map[string]interface{}, sourceIndex string) *V6Settings

type V7

type V7 struct {
	*elasticsearch7.Client
	*BaseES
}

func NewESV7

func NewESV7(esConfig *config.ESConfig, clusterVersion string) (*V7, error)

func (*V7) Bulk

func (es *V7) Bulk(buf *bytes.Buffer) error

func (*V7) BulkBody

func (es *V7) BulkBody(index string, buf *bytes.Buffer, doc *Doc) error

func (*V7) ClearScroll

func (es *V7) ClearScroll(scrollId string) error

func (*V7) ClusterHealth added in v1.1.0

func (es *V7) ClusterHealth(ctx context.Context) (map[string]interface{}, error)

func (*V7) Count added in v1.0.16

func (es *V7) Count(ctx context.Context, index string) (uint64, error)

func (*V7) CreateIndex

func (es *V7) CreateIndex(esSetting IESSettings) error

func (*V7) CreateTemplate added in v1.0.34

func (es *V7) CreateTemplate(ctx context.Context, name string, body map[string]interface{}) error

func (*V7) DeleteIndex

func (es *V7) DeleteIndex(index string) error

func (*V7) GetAddresses added in v1.1.0

func (es *V7) GetAddresses() []string

func (*V7) GetClusterVersion

func (es *V7) GetClusterVersion() string

func (*V7) GetIndexAliases

func (es *V7) GetIndexAliases(index string) (map[string]interface{}, error)

func (*V7) GetIndexMapping

func (es *V7) GetIndexMapping(index string) (map[string]interface{}, error)

func (*V7) GetIndexMappingAndSetting

func (es *V7) GetIndexMappingAndSetting(index string) (IESSettings, error)

func (*V7) GetIndexSettings

func (es *V7) GetIndexSettings(index string) (map[string]interface{}, error)

func (*V7) GetIndexes

func (es *V7) GetIndexes() ([]string, error)

func (*V7) GetInfo added in v1.1.0

func (es *V7) GetInfo(ctx context.Context) (map[string]interface{}, error)

func (*V7) GetPassword added in v1.1.0

func (es *V7) GetPassword() string

func (*V7) GetUser added in v1.1.0

func (es *V7) GetUser() string

func (*V7) IndexExisted

func (es *V7) IndexExisted(indexName string) (bool, error)

func (*V7) NewScroll

func (es *V7) NewScroll(ctx context.Context, index string, option *ScrollOption) (*ScrollResult, error)

func (*V7) NextScroll

func (es *V7) NextScroll(ctx context.Context, scrollId string, scrollTime uint) (*ScrollResult, error)

type V7Settings

type V7Settings struct {
	*V6Settings
}

func NewV7Settings

func NewV7Settings(settings, mappings, aliases map[string]interface{}, sourceIndex string) *V7Settings

type V8

type V8 struct {
	*elasticsearch8.Client
	*BaseES
}

func NewESV8

func NewESV8(esConfig *config.ESConfig, clusterVersion string) (*V8, error)

func (*V8) Bulk

func (es *V8) Bulk(buf *bytes.Buffer) error

func (*V8) BulkBody

func (es *V8) BulkBody(index string, buf *bytes.Buffer, doc *Doc) error

func (*V8) ClearScroll

func (es *V8) ClearScroll(scrollId string) error

func (*V8) ClusterHealth added in v1.1.0

func (es *V8) ClusterHealth(ctx context.Context) (map[string]interface{}, error)

func (*V8) Count added in v1.0.16

func (es *V8) Count(ctx context.Context, index string) (uint64, error)

func (*V8) CreateIndex

func (es *V8) CreateIndex(esSetting IESSettings) error

func (*V8) CreateTemplate added in v1.0.34

func (es *V8) CreateTemplate(ctx context.Context, name string, body map[string]interface{}) error

func (*V8) DeleteIndex

func (es *V8) DeleteIndex(index string) error

func (*V8) GetAddresses added in v1.1.0

func (es *V8) GetAddresses() []string

func (*V8) GetClusterVersion

func (es *V8) GetClusterVersion() string

func (*V8) GetIndexAliases

func (es *V8) GetIndexAliases(index string) (map[string]interface{}, error)

func (*V8) GetIndexMapping

func (es *V8) GetIndexMapping(index string) (map[string]interface{}, error)

func (*V8) GetIndexMappingAndSetting

func (es *V8) GetIndexMappingAndSetting(index string) (IESSettings, error)

func (*V8) GetIndexSettings

func (es *V8) GetIndexSettings(index string) (map[string]interface{}, error)

func (*V8) GetIndexes

func (es *V8) GetIndexes() ([]string, error)

func (*V8) GetInfo added in v1.1.0

func (es *V8) GetInfo(ctx context.Context) (map[string]interface{}, error)

func (*V8) GetPassword added in v1.1.0

func (es *V8) GetPassword() string

func (*V8) GetUser added in v1.1.0

func (es *V8) GetUser() string

func (*V8) IndexExisted

func (es *V8) IndexExisted(indexName string) (bool, error)

func (*V8) NewScroll

func (es *V8) NewScroll(ctx context.Context, index string, option *ScrollOption) (*ScrollResult, error)

func (*V8) NextScroll

func (es *V8) NextScroll(ctx context.Context, scrollId string, scrollTime uint) (*ScrollResult, error)

type V8Settings

type V8Settings struct {
	*V7Settings
}

func NewV8Settings

func NewV8Settings(settings, mappings, aliases map[string]interface{}, sourceIndex string) *V8Settings

func (*V8Settings) GetProperties

func (v8 *V8Settings) GetProperties() map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL