elasticsearch

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: AGPL-3.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const TypeName0 = "doc"
View Source
const TypeName5 = "doc"
View Source
const TypeName6 = "doc"
View Source
const TypeName7 = "_doc"

Variables

This section is empty.

Functions

This section is empty.

Types

type AliasesResponse

type AliasesResponse struct {
	Aliases map[string]struct {
		IsWriteIndex  bool        `json:"is_write_index,omitempty"`
		IsHiddenIndex bool        `json:"is_hidden,omitempty"`
		IndexRouting  string      `json:"index_routing,omitempty"`
		SearchRouting string      `json:"search_routing,omitempty"`
		Filter        interface{} `json:"filter,omitempty"`
	} `json:"aliases,omitempty"`
}

"dict" : { "aliases" : { "dictalias1" : { "is_write_index" : true }, "dictalias2" : { "is_write_index" : true } } },

type ESAPIV0

type ESAPIV0 struct {
	Elasticsearch string
	Version       elastic.Version
	// contains filtered or unexported fields
}

func (*ESAPIV0) Alias

func (c *ESAPIV0) Alias(body []byte) error

func (*ESAPIV0) Bulk

func (c *ESAPIV0) Bulk(data []byte) (*util.Result, error)

func (*ESAPIV0) CatNodes

func (c *ESAPIV0) CatNodes(colStr string) ([]elastic.CatNodeResponse, error)

func (*ESAPIV0) CatShards

func (c *ESAPIV0) CatShards() ([]elastic.CatShardResponse, error)

func (*ESAPIV0) CatShardsSpecEndpoint

func (c *ESAPIV0) CatShardsSpecEndpoint(endPoint string) ([]elastic.CatShardResponse, error)

func (*ESAPIV0) ClearScroll

func (s *ESAPIV0) ClearScroll(scrollId string) error

func (*ESAPIV0) Close

func (c *ESAPIV0) Close(name string) ([]byte, error)

func (*ESAPIV0) ClusterAllocationExplain added in v1.1.0

func (c *ESAPIV0) ClusterAllocationExplain(ctx context.Context, body []byte, params url.Values) ([]byte, error)

func (*ESAPIV0) ClusterHealth

func (c *ESAPIV0) ClusterHealth(ctx context.Context) (*elastic.ClusterHealth, error)

func (*ESAPIV0) ClusterHealthSpecEndpoint

func (c *ESAPIV0) ClusterHealthSpecEndpoint(ctx context.Context, endPoint string, level string) (*elastic.ClusterHealth, error)

ClusterHealthSpecEndpoint @param url eg: http://192.168.3.22:9200

func (*ESAPIV0) ClusterVersion

func (c *ESAPIV0) ClusterVersion() elastic.Version

func (*ESAPIV0) Count

func (c *ESAPIV0) Count(ctx context.Context, indexName string, body []byte) (*elastic.CountResponse, error)

Count used to count how many docs in one index

func (*ESAPIV0) CreateAutoFollowReplication

func (c *ESAPIV0) CreateAutoFollowReplication(autoFollowPatternName string, body []byte) error

func (*ESAPIV0) CreateIndex

func (c *ESAPIV0) CreateIndex(indexName string, settings map[string]interface{}) (err error)

func (*ESAPIV0) Delete

func (c *ESAPIV0) Delete(indexName, docType, id string, refresh ...string) (*elastic.DeleteResponse, error)

Delete used to delete document by id

func (*ESAPIV0) DeleteAutoFollowReplication

func (c *ESAPIV0) DeleteAutoFollowReplication(autoFollowPatternName string, body []byte) error

func (*ESAPIV0) DeleteByQuery

func (c *ESAPIV0) DeleteByQuery(indexName string, body []byte) (*elastic.DeleteByQueryResponse, error)

func (*ESAPIV0) DeleteILMPolicy

func (c *ESAPIV0) DeleteILMPolicy(target string) error

func (*ESAPIV0) DeleteIndex

func (c *ESAPIV0) DeleteIndex(indexName string) (err error)

func (*ESAPIV0) DeleteRole

func (c *ESAPIV0) DeleteRole(roleName string) error

func (*ESAPIV0) DeleteSearchTemplate

func (c *ESAPIV0) DeleteSearchTemplate(templateID string) error

func (*ESAPIV0) DeleteUser

func (c *ESAPIV0) DeleteUser(username string) error

func (*ESAPIV0) Exists

func (c *ESAPIV0) Exists(target string) (bool, error)

func (*ESAPIV0) FieldCaps

func (c *ESAPIV0) FieldCaps(target string) ([]byte, error)

func (*ESAPIV0) Flush

func (c *ESAPIV0) Flush(indexName string) ([]byte, error)

func (*ESAPIV0) Forcemerge

func (c *ESAPIV0) Forcemerge(indexName string, maxCount int) error

func (*ESAPIV0) Get

func (c *ESAPIV0) Get(indexName, docType, id string) (*elastic.GetResponse, error)

Get fetch document by id

func (*ESAPIV0) GetActivePreferredEndpoint

func (c *ESAPIV0) GetActivePreferredEndpoint(host string) string

func (*ESAPIV0) GetAliases

func (c *ESAPIV0) GetAliases() (*map[string]elastic.AliasInfo, error)

func (*ESAPIV0) GetAliasesAndIndices

func (c *ESAPIV0) GetAliasesAndIndices() (*elastic.AliasAndIndicesResponse, error)

func (*ESAPIV0) GetAliasesDetail

func (c *ESAPIV0) GetAliasesDetail() (*map[string]elastic.AliasDetailInfo, error)

func (*ESAPIV0) GetAutoFollowStats

func (c *ESAPIV0) GetAutoFollowStats(autoFollowPatternName string) ([]byte, error)

func (*ESAPIV0) GetClusterSettings

func (c *ESAPIV0) GetClusterSettings(values url.Values) (map[string]interface{}, error)

func (*ESAPIV0) GetClusterState

func (c *ESAPIV0) GetClusterState() (*elastic.ClusterState, error)

func (*ESAPIV0) GetClusterStats

func (c *ESAPIV0) GetClusterStats(ctx context.Context, node string) (*elastic.ClusterStats, error)

func (*ESAPIV0) GetClusterStatsSpecEndpoint

func (c *ESAPIV0) GetClusterStatsSpecEndpoint(ctx context.Context, node string, endPoint string) (*elastic.ClusterStats, error)

func (*ESAPIV0) GetEndpoint

func (c *ESAPIV0) GetEndpoint() string

func (*ESAPIV0) GetILMPolicy

func (c *ESAPIV0) GetILMPolicy(target string) (map[string]interface{}, error)

func (*ESAPIV0) GetIndex

func (c *ESAPIV0) GetIndex(indexName string) (map[string]interface{}, error)

func (*ESAPIV0) GetIndexRoutingTable

func (c *ESAPIV0) GetIndexRoutingTable(index string) (map[string][]elastic.IndexShardRouting, error)

func (*ESAPIV0) GetIndexSettings

func (c *ESAPIV0) GetIndexSettings(indexNames string) (*util.MapStr, error)

func (*ESAPIV0) GetIndexStats

func (c *ESAPIV0) GetIndexStats(indexName string) (*util.MapStr, error)

func (*ESAPIV0) GetIndices

func (c *ESAPIV0) GetIndices(pattern string) (*map[string]elastic.IndexInfo, error)

func (*ESAPIV0) GetIndicesStats

func (c *ESAPIV0) GetIndicesStats() *elastic.IndicesStats

func (*ESAPIV0) GetMajorVersion

func (c *ESAPIV0) GetMajorVersion() int

func (*ESAPIV0) GetMapping

func (c *ESAPIV0) GetMapping(copyAllIndexes bool, indexNames string) (string, int, *util.MapStr, error)

func (*ESAPIV0) GetMetadata

func (c *ESAPIV0) GetMetadata() *elastic.ElasticsearchMetadata

func (*ESAPIV0) GetNodeInfo

func (c *ESAPIV0) GetNodeInfo(nodeID string) (*elastic.NodesInfo, error)

func (*ESAPIV0) GetNodes

func (c *ESAPIV0) GetNodes() (*map[string]elastic.NodesInfo, error)

func (*ESAPIV0) GetNodesStats

func (c *ESAPIV0) GetNodesStats(nodeID, host string, level string) *elastic.NodesStats

func (*ESAPIV0) GetPrimaryShards

func (c *ESAPIV0) GetPrimaryShards() (*map[string]map[int]elastic.ShardInfo, error)

func (*ESAPIV0) GetPrivileges

func (c *ESAPIV0) GetPrivileges() ([]byte, error)

func (*ESAPIV0) GetRemoteInfo

func (c *ESAPIV0) GetRemoteInfo() ([]byte, error)

func (*ESAPIV0) GetReplicationFollowerStats

func (c *ESAPIV0) GetReplicationFollowerStats(followIndex string) ([]byte, error)

func (*ESAPIV0) GetReplicationStatus

func (c *ESAPIV0) GetReplicationStatus(followIndex string) ([]byte, error)

func (*ESAPIV0) GetRole

func (c *ESAPIV0) GetRole(roleName string) ([]byte, error)

func (*ESAPIV0) GetRoles

func (c *ESAPIV0) GetRoles() ([]byte, error)

func (*ESAPIV0) GetStats

func (c *ESAPIV0) GetStats() (*elastic.Stats, error)

func (*ESAPIV0) GetTemplate

func (c *ESAPIV0) GetTemplate(templateName string) (map[string]interface{}, error)

func (*ESAPIV0) GetUser

func (c *ESAPIV0) GetUser(username string) ([]byte, error)

func (*ESAPIV0) GetUsers

func (c *ESAPIV0) GetUsers() ([]byte, error)

func (*ESAPIV0) GetVersion

func (c *ESAPIV0) GetVersion() elastic.Version

func (*ESAPIV0) Index

func (c *ESAPIV0) Index(indexName, docType string, id interface{}, data interface{}, refresh string) (*elastic.InsertResponse, error)

Index index a document into elasticsearch

func (*ESAPIV0) IndexExists

func (c *ESAPIV0) IndexExists(indexName string) (bool, error)

func (*ESAPIV0) InitDefaultTemplate

func (c *ESAPIV0) InitDefaultTemplate(templateName, indexPrefix string)

func (*ESAPIV0) NewScroll

func (s *ESAPIV0) NewScroll(indexNames string, scrollTime string, docBufferCount int, query *elastic.SearchRequest, slicedId, maxSlicedCount int) ([]byte, error)

func (*ESAPIV0) NextScroll

func (s *ESAPIV0) NextScroll(ctx *elastic.APIContext, scrollTime string, scrollId string) ([]byte, error)

func (*ESAPIV0) Open

func (c *ESAPIV0) Open(name string) ([]byte, error)

func (*ESAPIV0) PauseReplication

func (c *ESAPIV0) PauseReplication(followIndex string, body []byte) error

func (*ESAPIV0) PutILMPolicy

func (c *ESAPIV0) PutILMPolicy(target string, policyConfig []byte) error

func (*ESAPIV0) PutRole

func (c *ESAPIV0) PutRole(roleName string, body []byte) error

func (*ESAPIV0) PutScript

func (c *ESAPIV0) PutScript(scriptName string, script []byte) ([]byte, error)

func (*ESAPIV0) PutTemplate

func (c *ESAPIV0) PutTemplate(templateName string, template []byte) ([]byte, error)

func (*ESAPIV0) PutUser

func (c *ESAPIV0) PutUser(username string, body []byte) error

func (*ESAPIV0) QueryDSL

func (c *ESAPIV0) QueryDSL(ctx context.Context, indexName string, queryArgs *[]util.KV, queryDSL []byte) (*elastic.SearchResponse, error)

func (*ESAPIV0) Refresh

func (s *ESAPIV0) Refresh(name string) (err error)

func (*ESAPIV0) Reindex

func (c *ESAPIV0) Reindex(body []byte) (*elastic.ReindexResponse, error)

func (*ESAPIV0) RenderTemplate

func (c *ESAPIV0) RenderTemplate(body map[string]interface{}) ([]byte, error)

func (*ESAPIV0) Request

func (c *ESAPIV0) Request(ctx context.Context, method, url string, body []byte) (result *util.Result, err error)

func (*ESAPIV0) ResumeReplication

func (c *ESAPIV0) ResumeReplication(followIndex string, body []byte) error

func (*ESAPIV0) ScriptExists

func (c *ESAPIV0) ScriptExists(scriptName string) (bool, error)

func (*ESAPIV0) Search

func (c *ESAPIV0) Search(indexName string, query *elastic.SearchRequest) (*elastic.SearchResponse, error)

Search used to execute a search query

func (*ESAPIV0) SearchByTemplate

func (c *ESAPIV0) SearchByTemplate(indexName, scriptName string, params map[string]interface{}) (*elastic.SearchResponse, error)

func (*ESAPIV0) SearchTasksByIds

func (c *ESAPIV0) SearchTasksByIds(ids []string) (*elastic.SearchResponse, error)

func (*ESAPIV0) SearchTemplate

func (c *ESAPIV0) SearchTemplate(body map[string]interface{}) ([]byte, error)

func (*ESAPIV0) SearchWithRawQueryDSL

func (c *ESAPIV0) SearchWithRawQueryDSL(indexName string, queryDSL []byte) (*elastic.SearchResponse, error)

func (*ESAPIV0) SetSearchTemplate

func (c *ESAPIV0) SetSearchTemplate(templateID string, body []byte) error

func (*ESAPIV0) StartReplication

func (c *ESAPIV0) StartReplication(followIndex string, body []byte) error

func (*ESAPIV0) StopReplication

func (c *ESAPIV0) StopReplication(indexName string, body []byte) error

func (*ESAPIV0) TemplateExists

func (c *ESAPIV0) TemplateExists(templateName string) (bool, error)

func (*ESAPIV0) Update

func (c *ESAPIV0) Update(indexName, docType string, id interface{}, data interface{}, refresh string) (*elastic.InsertResponse, error)

func (*ESAPIV0) UpdateByQuery

func (c *ESAPIV0) UpdateByQuery(indexName string, body []byte) (*elastic.UpdateByQueryResponse, error)

func (*ESAPIV0) UpdateClusterSettings

func (c *ESAPIV0) UpdateClusterSettings(body []byte) error

func (*ESAPIV0) UpdateIndexSettings

func (s *ESAPIV0) UpdateIndexSettings(name string, settings map[string]interface{}) error

func (*ESAPIV0) UpdateMapping

func (s *ESAPIV0) UpdateMapping(indexName string, docType string, mappings []byte) ([]byte, error)

type ESAPIV2

type ESAPIV2 struct {
	ESAPIV0
}

func (*ESAPIV2) ClearScroll

func (s *ESAPIV2) ClearScroll(scrollId string) error

func (*ESAPIV2) NextScroll

func (s *ESAPIV2) NextScroll(ctx *elastic.APIContext, scrollTime string, scrollId string) ([]byte, error)

type ESAPIV5

type ESAPIV5 struct {
	ESAPIV2
}

func (*ESAPIV5) CatNodes

func (c *ESAPIV5) CatNodes(colStr string) ([]elastic.CatNodeResponse, error)

func (*ESAPIV5) InitDefaultTemplate

func (c *ESAPIV5) InitDefaultTemplate(templateName, indexPrefix string)

func (*ESAPIV5) NewScroll

func (s *ESAPIV5) NewScroll(indexNames string, scrollTime string, docBufferCount int, query *elastic.SearchRequest, slicedId, maxSlicedCount int) ([]byte, error)

func (*ESAPIV5) SetSearchTemplate

func (s *ESAPIV5) SetSearchTemplate(templateID string, body []byte) error

func (*ESAPIV5) Update

func (c *ESAPIV5) Update(indexName, docType string, id interface{}, data interface{}, refresh string) (*elastic.InsertResponse, error)

type ESAPIV5_4

type ESAPIV5_4 struct {
	ESAPIV5
}

func (*ESAPIV5_4) FieldCaps

func (s *ESAPIV5_4) FieldCaps(target string) ([]byte, error)

type ESAPIV5_6

type ESAPIV5_6 struct {
	ESAPIV5_4
}

func (*ESAPIV5_6) ClearScroll

func (s *ESAPIV5_6) ClearScroll(scrollId string) error

func (*ESAPIV5_6) DeleteSearchTemplate

func (s *ESAPIV5_6) DeleteSearchTemplate(templateID string) error

func (*ESAPIV5_6) RenderTemplate

func (c *ESAPIV5_6) RenderTemplate(body map[string]interface{}) ([]byte, error)

func (*ESAPIV5_6) SearchTemplate

func (c *ESAPIV5_6) SearchTemplate(body map[string]interface{}) ([]byte, error)

type ESAPIV6

type ESAPIV6 struct {
	ESAPIV5_6
}

func (*ESAPIV6) InitDefaultTemplate

func (c *ESAPIV6) InitDefaultTemplate(templateName, indexPrefix string)

type ESAPIV6_6

type ESAPIV6_6 struct {
	ESAPIV6
}

func (*ESAPIV6_6) DeleteILMPolicy

func (s *ESAPIV6_6) DeleteILMPolicy(target string) error

func (*ESAPIV6_6) GetILMPolicy

func (s *ESAPIV6_6) GetILMPolicy(target string) (map[string]interface{}, error)

func (*ESAPIV6_6) PutILMPolicy

func (s *ESAPIV6_6) PutILMPolicy(target string, policyConfig []byte) error

func (*ESAPIV6_6) UpdateMapping

func (s *ESAPIV6_6) UpdateMapping(indexName string, docType string, mappings []byte) ([]byte, error)

type ESAPIV7

type ESAPIV7 struct {
	ESAPIV6_6
}

func (*ESAPIV7) CreateIndex

func (c *ESAPIV7) CreateIndex(indexName string, settings map[string]interface{}) (err error)

func (*ESAPIV7) Delete

func (c *ESAPIV7) Delete(indexName, docType, id string, refresh ...string) (*elastic.DeleteResponse, error)

Delete used to delete document by id

func (*ESAPIV7) Get

func (c *ESAPIV7) Get(indexName, docType, id string) (*elastic.GetResponse, error)

Get fetch document by id

func (*ESAPIV7) Index

func (c *ESAPIV7) Index(indexName, docType string, id interface{}, data interface{}, refresh string) (*elastic.InsertResponse, error)

IndexDoc index a document into elasticsearch

func (*ESAPIV7) InitDefaultTemplate

func (c *ESAPIV7) InitDefaultTemplate(templateName, indexPrefix string)

func (*ESAPIV7) PutScript

func (c *ESAPIV7) PutScript(scriptName string, script []byte) ([]byte, error)

func (*ESAPIV7) ScriptExists

func (c *ESAPIV7) ScriptExists(scriptName string) (bool, error)

func (*ESAPIV7) SearchByTemplate

func (c *ESAPIV7) SearchByTemplate(indexName, scriptName string, params map[string]interface{}) (*elastic.SearchResponse, error)

func (*ESAPIV7) Update

func (c *ESAPIV7) Update(indexName, docType string, id interface{}, data interface{}, refresh string) (*elastic.InsertResponse, error)

func (*ESAPIV7) UpdateMapping

func (c *ESAPIV7) UpdateMapping(indexName string, docType string, mappings []byte) ([]byte, error)

type ESAPIV7_3

type ESAPIV7_3 struct {
	ESAPIV7
}

func (*ESAPIV7_3) GetClusterState

func (c *ESAPIV7_3) GetClusterState() (*elastic.ClusterState, error)

func (*ESAPIV7_3) GetStats

func (c *ESAPIV7_3) GetStats() (*elastic.Stats, error)

type ESAPIV7_7

type ESAPIV7_7 struct {
	ESAPIV7_3
}

func (*ESAPIV7_7) GetIndices

func (c *ESAPIV7_7) GetIndices(pattern string) (*map[string]elastic.IndexInfo, error)

type ESAPIV8

type ESAPIV8 struct {
	ESAPIV7_7
}

func (*ESAPIV8) CreateIndex

func (c *ESAPIV8) CreateIndex(indexName string, settings map[string]interface{}) (err error)

func (*ESAPIV8) Delete

func (c *ESAPIV8) Delete(indexName, docType, id string, refresh ...string) (*elastic.DeleteResponse, error)

Delete used to delete document by id

func (*ESAPIV8) Flush

func (c *ESAPIV8) Flush(indexName string) ([]byte, error)

func (*ESAPIV8) Get

func (c *ESAPIV8) Get(indexName, docType, id string) (*elastic.GetResponse, error)

Get fetch document by id

func (*ESAPIV8) Index

func (c *ESAPIV8) Index(indexName, docType string, id interface{}, data interface{}, refresh string) (*elastic.InsertResponse, error)

IndexDoc index a document into elasticsearch

func (*ESAPIV8) InitDefaultTemplate

func (c *ESAPIV8) InitDefaultTemplate(templateName, indexPrefix string)

Jump to

Keyboard shortcuts

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