elasticsearch

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(url string) (*Client, error)

func (*Client) CloseIndex

func (ec *Client) CloseIndex(ctx context.Context, index string) error

func (*Client) Count

func (ec *Client) Count(ctx context.Context, index string) (int, error)

func (*Client) CreateIndex

func (ec *Client) CreateIndex(ctx context.Context, index string, body map[string]any) error

func (*Client) DeleteByQuery

func (ec *Client) DeleteByQuery(ctx context.Context, req *searchstore.DeleteByQueryRequest) error

func (*Client) DeleteIndex

func (ec *Client) DeleteIndex(ctx context.Context, index []string) error

func (*Client) GetIndexAlias

func (ec *Client) GetIndexAlias(ctx context.Context, name string) (map[string]any, error)

func (*Client) GetIndexMappings

func (ec *Client) GetIndexMappings(ctx context.Context, index string) (*searchstore.Mappings, error)

func (*Client) GetIndicesStats

func (ec *Client) GetIndicesStats(ctx context.Context, indexPattern string) ([]searchstore.IndexStats, error)

GetIndicesStats uses the index stats API to fetch statistics about indices. indexPattern is a wildcard pattern used to select the indices we care about.

func (*Client) GetMapper

func (ec *Client) GetMapper() searchstore.Mapper

func (*Client) Index

func (ec *Client) Index(ctx context.Context, req *searchstore.IndexRequest) error

func (*Client) IndexExists

func (ec *Client) IndexExists(ctx context.Context, index string) (bool, error)

func (*Client) IndexWithID

func (ec *Client) IndexWithID(ctx context.Context, req *searchstore.IndexWithIDRequest) error

func (*Client) ListIndices

func (ec *Client) ListIndices(ctx context.Context, indices []string) ([]string, error)

ListIndices returns the list of indices that match the index name pattern on input from the OS cluster

func (*Client) Perform

func (ec *Client) Perform(req *http.Request) (*http.Response, error)

func (*Client) PutIndexAlias

func (ec *Client) PutIndexAlias(ctx context.Context, index []string, name string) error

func (*Client) PutIndexMappings

func (ec *Client) PutIndexMappings(ctx context.Context, index string, mapping map[string]any) error

PutIndexMappings add field type mapping data to a previously created ES index Dynamic mapping is disabled upon index creation, so it is a requirement to explicitly define mappings for each column

func (*Client) PutIndexSettings

func (ec *Client) PutIndexSettings(ctx context.Context, index string, settings map[string]any) error

func (*Client) RefreshIndex

func (ec *Client) RefreshIndex(ctx context.Context, index string) error

func (*Client) Search

func (*Client) SendBulkRequest

func (ec *Client) SendBulkRequest(ctx context.Context, items []searchstore.BulkItem) ([]searchstore.BulkItem, error)

SendBulkRequest can perform multiple indexing or delete operations in a single call

type Mapper

type Mapper struct{}

func NewMapper

func NewMapper() *Mapper

func (*Mapper) FieldMapping

func (m *Mapper) FieldMapping(field *searchstore.Field) (map[string]any, error)

func (*Mapper) GetDefaultIndexSettings

func (m *Mapper) GetDefaultIndexSettings() map[string]any

Jump to

Keyboard shortcuts

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