elasticsearchv8

package
v4.6.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C

func C() *elasticsearch.TypedClient

C returns the elasticsearch client singleton

func CheckVersion

func CheckVersion() error

func ConvertFactToSearchRequestV8

func ConvertFactToSearchRequestV8(f engine.Fact, ti time.Time, parameters map[string]string) (*search.Request, error)

func NewPutTemplateRequestV8

func NewPutTemplateRequestV8(indexPatterns []string, model modeler.Model) *puttemplate.Request

NewPutTemplateRequestV8 constructor the ES template

func ReplaceGlobals

func ReplaceGlobals(config elasticsearch.Config) error

ReplaceGlobals affect new elasticsearch credentials and connection to the global repository singleton

Types

type BulkIndexMeta

type BulkIndexMeta struct {
	Index BulkIndexMetaDetail `json:"index"`
}

type BulkIndexMetaDetail

type BulkIndexMetaDetail struct {
	S_Index string `json:"_index"`
	S_Type  string `json:"_type"`
	S_Id    string `json:"_id"`
}

type BulkIndexResponse

type BulkIndexResponse struct {
	Took   int                                 `json:"took,omitempty"`
	Errors bool                                `json:"errors,omitempty"`
	Items  []map[string]*BulkIndexResponseItem `json:"items,omitempty"`
}

func (*BulkIndexResponse) Failed

Failed returns those items of a bulkIndex response that have errors, i.e. those that don't have a status code between 200 and 299.

type BulkIndexResponseItem

type BulkIndexResponseItem struct {
	Index      string `json:"_index"`
	DocumentID string `json:"_id"`
	Version    int64  `json:"_version"`
	Result     string `json:"result"`
	Status     int    `json:"status"`
	SeqNo      int64  `json:"_seq_no"`
	PrimTerm   int64  `json:"_primary_term"`

	Shards struct {
		Total      int `json:"total"`
		Successful int `json:"successful"`
		Failed     int `json:"failed"`
	} `json:"_shards"`

	Error struct {
		Type   string `json:"type"`
		Reason string `json:"reason"`
		Cause  struct {
			Type   string `json:"type"`
			Reason string `json:"reason"`
		} `json:"caused_by"`
	} `json:"error,omitempty"`
}

BulkIndexResponseItem represents the Elasticsearch response item.

type Credentials

type Credentials struct {
	URLs []string
}

Credentials is used to store the elasticsearch credentials

Jump to

Keyboard shortcuts

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