elastic

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 15 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildID

func BuildID(id string, key string) string

func BuildSearchRequest

func BuildSearchRequest(query interface{}, index string) (esapi.SearchRequest, error)

func SetDiscSpaceThresholds

func SetDiscSpaceThresholds(elasticURL string) error

func TurnOffIndexReadOnlyMode

func TurnOffIndexReadOnlyMode(index string, elasticURL string) error

Types

type ElasticDriver

type ElasticDriver interface {
	SetProperty(name string, prop interface{}) error
	// AddMapping add a document mapping to be registered with ElasticSearch
	AddMapping(mapping Mapping) error
	//Initialize the driver, register mappings with elasticserach. Timeout in ms to wait for elastic to be available.
	Initialize(timeout time.Duration) error
	GetConnection() (datastore.Connection, error)
}

ElasticDriver describes an the Elastic Search driver

func New

func New(host string, port uint16, index string) ElasticDriver

New creates a new ElasticDriver

type Mapping

type Mapping struct {
	Entries map[string]interface{}
}

func NewMapping

func NewMapping(mapping string) (Mapping, error)

func (Mapping) MarshalJSON

func (m Mapping) MarshalJSON() ([]byte, error)

MarshalJSON returns *m as the JSON encoding of m.

func (*Mapping) UnmarshalJSON

func (m *Mapping) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

Jump to

Keyboard shortcuts

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