elastic

package
v0.0.0-...-d9936ee Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticSearch

type ElasticSearch interface {
	Insert(index string, data any, documentID string) error
	Remove(documentID string, index string) error
	Ping() error
	Search(indexName, body string) (map[string]interface{}, error)
}

func NewElasticSearch

func NewElasticSearch(elasticSearchConn ElasticSearchConn) (ElasticSearch, error)

type ElasticSearchConn

type ElasticSearchConn struct {
	Url      string
	UserName string
	Password string
}

type ResponseError

type ResponseError struct {
	Error struct {
		RootCause []struct {
			Type   string `json:"type"`
			Reason string `json:"reason"`
		} `json:"root_cause"`
		Type     string `json:"type"`
		Reason   string `json:"reason"`
		CausedBy struct {
			Type   string `json:"type"`
			Reason string `json:"reason"`
		} `json:"caused_by"`
	} `json:"error"`
	Status int `json:"status"`
}

type ResponseRequest

type ResponseRequest struct {
	Index         string  `json:"_index"`
	Type          string  `json:"_type"`
	ID            string  `json:"_id"`
	Version       float64 `json:"_version"`
	Result        string  `json:"result"`
	ForcedRefresh bool    `json:"forced_refresh"`
	Shards        struct {
		Total      float64 `json:"total"`
		Successful float64 `json:"successful"`
		Failed     float64 `json:"failed"`
	} `json:"_shards"`
	SeqNo       float64 `json:"_seq_no"`
	PrimaryTerm float64 `json:"_primary_term"`
}

Jump to

Keyboard shortcuts

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