elastic

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 9 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
}

Client Elasticsearch client

func NewClient

func NewClient(addresses []string, username, password string) (*Client, error)

NewClient new Elasticsearch client

func (*Client) DeleteDocument

func (c *Client) DeleteDocument(ctx context.Context, indexName, documentID string) error

DeleteDocument delete document from Elasticsearch

func (*Client) GetClient

func (c *Client) GetClient() *elasticsearch.Client

GetClient get Elasticsearch client

func (*Client) IndexDocument

func (c *Client) IndexDocument(ctx context.Context, indexName string, documentID string, document any) error

IndexDocument index document to Elasticsearch

func (*Client) Search

func (c *Client) Search(ctx context.Context, indexName, query string) (*esapi.Response, error)

Search search from Elasticsearch

Jump to

Keyboard shortcuts

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