Documentation
¶
Index ¶
- Variables
- type Client
- func (cl *Client) CreateIndex(ctx context.Context, index string, body io.Reader) error
- func (cl *Client) DeleteDocument(ctx context.Context, indexName string, documentID string) error
- func (cl *Client) GetDocument(ctx context.Context, indexName string, documentID string) (map[string]interface{}, error)
- func (cl *Client) IsIndexExists(ctx context.Context, index string) (bool, error)
- func (cl *Client) SaveDocument(ctx context.Context, indexName string, documentID string, body io.Reader) error
- func (cl *Client) SearchDocument(ctx context.Context, indexName string, body io.Reader, options ...Option) (*SearchResponse, error)
- type ESError
- type Hit
- type Hits
- type Option
- type SearchResponse
- type Total
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = &ESError{
StatusCode: 404,
Message: "Object not found",
}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config elasticsearch.Config) (*Client, error)
NewClient creates a new Elasticsearch client instance
func (*Client) CreateIndex ¶
CreateIndex creates a new index with the specified settings and mappings
func (*Client) DeleteDocument ¶
DeleteDocument deletes a document with the specified ID
func (*Client) GetDocument ¶
func (cl *Client) GetDocument(ctx context.Context, indexName string, documentID string) (map[string]interface{}, error)
GetDocument gets a document with the specified ID
func (*Client) IsIndexExists ¶
IsIndexExists Check if an index exists in Elasticsearch
type SearchResponse ¶
Click to show internal directories.
Click to hide internal directories.