Documentation
¶
Overview ¶
Package elastic holds the ElasticSearch specific meta declarations and util functions.
Index ¶
- func GetDataStream(c zhttp.Context)
- func MatchAnyPattern(name string, patterns []string) bool
- func MatchPattern(name, pattern string) bool
- func PutDataStream(c zhttp.Context)
- func SplitPatterns(s string) []string
- type CatHealthResponse
- type CatIndexResponse
- type ClusterHealthResponse
- type CountResponse
- type ESInfo
- type ESInfoVersion
- type ESLicense
- type ESXPack
- type FieldCap
- type FieldCapsResponse
- type Mappings
- type Property
- type ReindexResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDataStream ¶
func MatchAnyPattern ¶
MatchAnyPattern reports whether name matches at least one of the patterns. An empty pattern list matches everything.
func MatchPattern ¶
MatchPattern reports whether name matches the glob pattern. An empty pattern matches everything, an invalid pattern falls back to an exact comparison.
func PutDataStream ¶
func SplitPatterns ¶
SplitPatterns splits a comma separated list of patterns, dropping empty ones.
Types ¶
type CatHealthResponse ¶
type CatHealthResponse struct {
Epoch string `json:"epoch"`
Timestamp string `json:"timestamp"`
Cluster string `json:"cluster"`
Status string `json:"status"`
NodeTotal string `json:"node.total"`
NodeData string `json:"node.data"`
Shards string `json:"shards"`
Pri string `json:"pri"`
Relo string `json:"relo"`
Init string `json:"init"`
Unassign string `json:"unassign"`
PendingTasks string `json:"pending_tasks"`
MaxTaskWaitTime string `json:"max_task_wait_time"`
ActiveShardsPercent string `json:"active_shards_percent"`
}
CatHealthResponse is one row of the ES compatible _cat/health API.
type CatIndexResponse ¶
type CatIndexResponse struct {
Health string `json:"health"`
Status string `json:"status"`
Index string `json:"index"`
UUID string `json:"uuid"`
Pri string `json:"pri"`
Rep string `json:"rep"`
DocsCount string `json:"docs.count"`
DocsDeleted string `json:"docs.deleted"`
StoreSize string `json:"store.size"`
PriStoreSize string `json:"pri.store.size"`
}
CatIndexResponse is one row of the ES compatible _cat/indices API. All values are strings, like elasticsearch renders them.
type ClusterHealthResponse ¶
type ClusterHealthResponse 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 int64 `json:"active_primary_shards"`
ActiveShards int64 `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"`
}
ClusterHealthResponse is the response of the ES compatible _cluster/health API. ZedSearch is single node, so the cluster is always green with one node.
type CountResponse ¶
CountResponse is the response of the ES compatible _count API.
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"`
}
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 ESXPack ¶
type ESXPack struct {
Build map[string]bool `json:"build"`
Features map[string]bool `json:"features"`
License ESLicense `json:"license"`
}
func NewESXPack ¶
type FieldCap ¶
type FieldCap struct {
Type string `json:"type"`
MetadataField bool `json:"metadata_field"`
Searchable bool `json:"searchable"`
Aggregatable bool `json:"aggregatable"`
}
FieldCap holds the capabilities of a single field for one field type.
type FieldCapsResponse ¶
type FieldCapsResponse struct {
Indices []string `json:"indices"`
Fields map[string]map[string]FieldCap `json:"fields"`
}
FieldCapsResponse is the response of the ES compatible _field_caps API.
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 (*Mappings) GetProperty ¶
GetProperty returns the property by its field name. This function is concurrent safe.
func (*Mappings) Len ¶
Len returns the number of properties stored. This function is concurrent safe.
func (*Mappings) ListProperty ¶
ListProperty returns all properties of the mapping. This function is concurrent safe.
func (*Mappings) MarshalJSON ¶
MarshalJSON overwrites the default marshaler. This function is concurrent safe.
func (*Mappings) SetProperty ¶
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 Zed?
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.
type ReindexResponse ¶
type ReindexResponse struct {
Took int64 `json:"took"`
TimedOut bool `json:"timed_out"`
Total int `json:"total"`
Created int `json:"created"`
Updated int `json:"updated"`
Deleted int `json:"deleted"`
Batches int `json:"batches"`
VersionConflicts int `json:"version_conflicts"`
Noops int `json:"noops"`
Retries meta.HttpRetriesResponse `json:"retries"`
ThrottledMillis int `json:"throttled_millis"`
RequestsPerSecond int `json:"requests_per_second"`
ThrottledUntilMillis int `json:"throttled_until_millis"`
Failures []string `json:"failures"`
}
ReindexResponse is the response of the ES compatible _reindex API.