elastic

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package elastic holds the ElasticSearch specific meta declarations and util functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDataStream

func GetDataStream(c *gin.Context)

func PutDataStream

func PutDataStream(c *gin.Context)

Types

type ESInfo

type ESInfo struct {
	Name        string        `json:"name"`
	ClusterName string        `json:"cluster_name"`
	ClusterUUID string        `json:"cluster_uuid"`
	Version     ESInfoVersion `json:"version"`
	Tagline     string        `json:"tagline"`
}

func NewESInfo

func NewESInfo(c *gin.Context) *ESInfo

type ESInfoVersion

type ESInfoVersion struct {
	Number                    string `json:"number"`
	BuildFlavor               string `json:"build_flavor"`
	BuildHash                 string `json:"build_hash"`
	BuildDate                 string `json:"build_date"`
	BuildSnapshot             bool   `json:"build_snapshot"`
	LuceneVersion             string `json:"lucene_version"`
	MinimumWireVersion        string `json:"minimum_wire_version"`
	MinimumIndexCompatibility string `json:"minimum_index_compatibility"`
}

type ESLicense

type ESLicense struct {
	Status string `json:"status"`
}

func NewESLicense

func NewESLicense(_ *gin.Context) *ESLicense

type ESXPack

type ESXPack struct {
	Build    map[string]bool `json:"build"`
	Features map[string]bool `json:"features"`
	License  ESLicense       `json:"license"`
}

func NewESXPack

func NewESXPack(_ *gin.Context) *ESXPack

type Mappings

type Mappings struct {

	// Properties holds the index properties.
	Properties map[string]Property `json:"properties,omitempty"`
	// contains filtered or unexported fields
}

Mappings holds the index mappings.

func NewMappings

func NewMappings() *Mappings

NewMappings returns a initialized Mappings object.

func (*Mappings) GetProperty

func (t *Mappings) GetProperty(field string) (Property, bool)

GetProperty returns the property by its field name. This function is concurrent safe.

func (*Mappings) Len

func (t *Mappings) Len() int

Len returns the number of properties stored. This function is concurrent safe.

func (*Mappings) ListProperty

func (t *Mappings) ListProperty() map[string]Property

ListProperty returns all properties of the mapping. This function is concurrent safe.

func (*Mappings) MarshalJSON

func (t *Mappings) MarshalJSON() ([]byte, error)

MarshalJSON overwrites the default marshaler. This function is concurrent safe.

func (*Mappings) SetProperty

func (t *Mappings) SetProperty(field string, prop Property)

SetProperty sets/ adds the given property to the mapping. This function is concurrent safe.

type Property

type Property struct {
	// Type holds the field type.
	// The type field may be empty, i.e., if the field represents an object.
	Type string `json:"type,omitempty"`
	// Properties holds the sub-properties of this property.
	Properties map[string]Property `json:"properties,omitempty"`
	// Fields the same string value to be indexed in multiple ways for different purposes,
	// such as one field for search and a multi-field for sorting and aggregations,
	// or the same string value analyzed by different analyzers.
	Fields map[string]Property `json:"fields,omitempty"`
	// IgnoreAbove prevents indexing of strings longer than the configured value.
	// TODO: Should this be supported by Zinc?
	IgnoreAbove    uint   `json:"ignore_above,omitempty"`
	Analyzer       string `json:"analyzer,omitempty"`
	SearchAnalyzer string `json:"search_analyzer,omitempty"`
	// Format holds the property format.
	Format string `json:"format,omitempty"`
}

Property holds the property of a single field.

func NewProperty

func NewProperty(typ string) Property

NewProperty returns a new Property object.

Jump to

Keyboard shortcuts

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