elasticsearch

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_RESULT_SIZE_KEY = "esDefaultResultSize"

Variables

This section is empty.

Functions

func GetDefaultResultSize added in v1.1.0

func GetDefaultResultSize() int

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

NewClient creates a new client with configuration from cfg.

func (*Client) AddAliasesToMappings added in v1.2.0

func (e *Client) AddAliasesToMappings(ctx context.Context, aliasToIndexMap map[string]string, mappings map[string]interface{})

AddAliasesToMappings adds aliases to mappings Each alias is added as a separate index The mappings of original index are copied to alias index

func (*Client) GetAliases added in v1.2.0

func (e *Client) GetAliases(ctx context.Context) (aliasToIndexMap map[string]string, err error)

GetAliases Returns aliases for all indices.

func (*Client) GetIndices

func (e *Client) GetIndices(ctx context.Context) ([]string, error)

GetIndices Returns comma seperated list of indices that matches the ELASTICSEARCH_INDEX_PATTERN env character.

func (*Client) GetInfo

func (e *Client) GetInfo(ctx context.Context) (interface{}, error)

GetInfo retrieves information about Elasticsearch.

func (*Client) GetMappings

func (e *Client) GetMappings(ctx context.Context, indices []string) (mappings map[string]interface{}, err error)

GetMappings Returns mappings for comma seperated list of indices.

func (*Client) Ping

func (e *Client) Ping() error

Ping returns whether the Elasticsearch cluster is running.

func (*Client) Search

func (e *Client) Search(ctx context.Context, index string, body map[string]interface{}) (map[string]interface{}, error)

Search performs a search operation in elastic search.

Jump to

Keyboard shortcuts

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