sielastic

package
v2.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrElasticResponseHasError = errors.New("response has error")

Functions

func DefaultElasticsearchClient

func DefaultElasticsearchClient(elasticAddresses, userName, password string) (*elasticsearch.Client, error)

Types

type Client

type Client struct {
	*elasticsearch.Client
}

func NewClient

func NewClient(client *elasticsearch.Client) *Client

func (*Client) IndexDocument

func (c *Client) IndexDocument(ctx context.Context, indexName string, body []byte) (map[string]interface{}, error)

func (*Client) SearchDocuments

func (c *Client) SearchDocuments(ctx context.Context, indexName string, body map[string]interface{}, dest any) error

type Resp

type Resp struct {
	Error  RespError `json:"error"`
	Status int       `json:"status"`
}

type RespError

type RespError struct {
	RootCause []RespRootCause `json:"root_cause"`
	Reason    string          `json:"reason"`
}

type RespRootCause

type RespRootCause struct {
	Type   string `json:"type"`
	Reason string `json:"reason"`
	Line   int    `json:"line"`
	Col    int    `json:"col"`
}

Jump to

Keyboard shortcuts

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