es

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ElasticV5 = "5"
	ElasticV6 = "6"
	ElasticV7 = "7"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregations

type Aggregations struct {
	CardinalityAggregation   `json:"cardinality_aggregation,omitempty"`
	DateHistogramAggregation `json:"date_histogram_aggregation,omitempty"`
}

type Bucket

type Bucket struct {
	Key   int64 `json:"key,omitempty"`
	Count int64 `json:"doc_count,omitempty"`
}

type CardinalityAggregation

type CardinalityAggregation struct {
	Value int64 `json:"value,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Elasticsearch client

func NewClient

func NewClient(host string, basicAuth bool, username, password, indexPrefix, version string) (*Client, error)

func (*Client) ClearScroll

func (c *Client) ClearScroll(id string)

func (*Client) GetTotalHitCount

func (c *Client) GetTotalHitCount(v interface{}) int64

func (*Client) Scroll

func (c *Client) Scroll(id string) (*Response, error)

func (*Client) Search

func (c *Client) Search(builder *query.Builder, startTime, endTime time.Time, scroll bool) (*Response, error)

type DateHistogramAggregation

type DateHistogramAggregation struct {
	Buckets []Bucket `json:"buckets,omitempty"`
}

type Hit

type Hit struct {
	Source interface{} `json:"_source,omitempty"`
	Sort   []int64     `json:"sort,omitempty"`
}

type Hits

type Hits struct {
	Total   interface{} `json:"total,omitempty"` // `As of Elasticsearch v7.x, hits.total is changed incompatibly
	AllHits []Hit       `json:"hits,omitempty"`
}

type Response

type Response struct {
	ScrollId     string `json:"_scroll_id,omitempty"`
	Hits         `json:"hits,omitempty"`
	Aggregations `json:"aggregations,omitempty"`
}

Directories

Path Synopsis
v5
v6
v7

Jump to

Keyboard shortcuts

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