Help us shape the future of Go! Take the 2026 Go Developer Survey

elasticsearch

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterStats

type ClusterStats struct {
	Nodes       map[string]NodeInfo `json:"nodes"`
	ClusterName string              `json:"cluster_name"`
}

type ErrorRootCause added in v1.0.0

type ErrorRootCause struct {
	Type   string `json:"type"`
	Reason string `json:"reason"`
}

type HealthResponse

type HealthResponse struct {
	ClusterName                 string  `json:"cluster_name"`
	Status                      string  `json:"status"`
	TimedOut                    bool    `json:"timed_out"`
	NumberOfNodes               int     `json:"number_of_nodes"`
	NumberOfDataNodes           int     `json:"number_of_data_nodes"`
	ActivePrimaryShards         int     `json:"active_primary_shards"`
	ActiveShards                int     `json:"active_shards"`
	RelocatingShards            int     `json:"relocating_shards"`
	InitializingShards          int     `json:"initializing_shards"`
	UnassignedShards            int     `json:"unassigned_shards"`
	DelayedUnassignedShards     int     `json:"delayed_unassigned_shards"`
	NumberOfPendingTasks        int     `json:"number_of_pending_tasks"`
	NumberOfInFlightFetch       int     `json:"number_of_in_flight_fetch"`
	TaskMaxWaitingInQueueMillis int     `json:"task_max_waiting_in_queue_millis"`
	ActiveShardsPercentAsNumber float64 `json:"active_shards_percent_as_number"`
}

type IngestInfo

type IngestInfo struct {
	Total     IngestStats             `json:"total"`
	Pipelines map[string]PipelineInfo `json:"pipelines"`
}

type IngestStats

type IngestStats struct {
	Count   float64 `json:"count"`
	Current float64 `json:"current"`
	Failed  float64 `json:"failed"`
}

type NodeInfo

type NodeInfo struct {
	IP     string     `json:"ip"`
	Ingest IngestInfo `json:"ingest"`
}

type PipelineInfo

type PipelineInfo struct {
	Count   float64 `json:"count"`
	Current float64 `json:"current"`
	Failed  float64 `json:"failed"`
}

type Query

type Query struct {
	QueryString *QueryString `json:"query_string,omitempty"`
}

Query represents a query against elastic search https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

type QueryString

type QueryString struct {
	Query string `json:"query"`
}

QueryString, what the name says https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

type SearchHit

type SearchHit struct {
	Index  string         `json:"_index"`
	Type   string         `json:"_type"`
	Source map[string]any `json:"_source"`
	ID     string         `json:"_id"`
}

type SearchHits

type SearchHits struct {
	Total SearchTotal `json:"total"`
	Hits  []SearchHit `json:"hits"`
}

type SearchRequest

type SearchRequest struct {
	Query Query `json:"query"`
}

type SearchResponse

type SearchResponse struct {
	Hits  SearchHits `json:"hits"`
	Error struct {
		RootCause []ErrorRootCause `json:"root_cause,omitempty"`
	}
}

SearchResponse represents the answer to an elastic search query https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-api-response-body

func (*SearchResponse) GetErrors added in v1.0.0

func (r *SearchResponse) GetErrors() string

GetErrors returns the error reasons when they are present in the response

type SearchTotal

type SearchTotal struct {
	Value uint `json:"value"`
}

type Snapshot added in v0.5.0

type Snapshot struct {
	Snapshot           string   `json:"snapshot"`
	UUID               string   `json:"uuid"`
	Repository         string   `json:"repository"`
	Indices            []string `json:"indices"`
	DataStreams        []string `json:"data_streams"`
	IncludeGlobalState bool     `json:"include_global_state"`
	State              string   `json:"state"`
	StartTimeInMillis  int      `json:"start_time_in_millis"`
	EndTimeInMillis    int      `json:"end_time_in_millis"`
	DurationInMillis   int      `json:"duration_in_millis"`
	Shards             struct {
		Total      int `json:"total"`
		Failed     int `json:"failed"`
		Successful int `json:"successful"`
	} `json:"shards"`
}

type SnapshotResponse added in v0.5.0

type SnapshotResponse struct {
	Snapshots []Snapshot `json:"snapshots"`
	Total     int        `json:"total"`
	Remaining int        `json:"remaining"`
}

Jump to

Keyboard shortcuts

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