es5

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

View Source
const (
	IndexNotAnalyzed = "not_analyzed"
	TypeString       = "string"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agg

type Agg struct {
	Filter        *Filter        `json:"filter,omitempty"`
	Nested        *Nested        `json:"nested,omitempty"`
	Terms         *Term          `json:"terms,omitempty"`
	Aggs          map[string]Agg `json:"aggs,omitempty"`
	DateHistogram *DateHistogram `json:"date_histogram,omitempty"`
}

Agg represents one aggregation. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html DateHistogram: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html#search-aggregations-bucket-datehistogram-aggregation

type AggResponseNestedWIP

type AggResponseNestedWIP struct {
	Aggregations map[string]map[string]interface{} `json:"aggregations,omitempty"`
}

AggResponseWIP is working response object used to format an aggregations response using Elastirad's AggResponseRad struct.

type AggResponseSimple

type AggResponseSimple struct {
	Aggregations map[string]Aggregation `json:"aggregations,omitempty"`
}

type Aggregation

type Aggregation struct {
	DocCountErrorUpperBound int      `json:"doc_count_error_upper_bound,omitempty"`
	SumOtherDocCount        int      `json:"sum_other_doc_count,omitempty"`
	Buckets                 []Bucket `json:"buckets,omitempty"`
}

Aggregation is a Elasticsearch aggregation response struct.

type AggregationResRad

type AggregationResRad struct {
	AggregationName string      `json:"aggregation_name,omitempty"`
	Type            string      `json:"type,omitempty"`
	DocCount        int         `json:"doc_count,omitempty"`
	AggregationData Aggregation `json:"aggregation_data,omitempty"`
}

AggregationResRad is a Go optimized response struct.

func AggregationResRadArrayFromBodyBytes

func AggregationResRadArrayFromBodyBytes(bytes []byte) ([]AggregationResRad, error)

AggregationResRadArrayFromBodyBytes is used to parse simple, non-nested aggregations.

func AggregationResRadArrayFromBodyBytesNested

func AggregationResRadArrayFromBodyBytesNested(bytes []byte) ([]AggregationResRad, error)

AggregationResRadArrayFromBodyBytesNested returns an array of formatted Aggregations using AggregationResRad structs given a HTTP response byte array. Nested

type AggsBody

type AggsBody struct {
	Size  int            `json:"size"`
	Query *Query         `json:"query,omitempty"`
	Aggs  map[string]Agg `json:"aggs,omitempty"`
}

AggsBody represents the body of an aggregation API request.

type All

type All struct {
	Enabled bool `json:"enabled,omitempty"`
}

type BoolQuery

type BoolQuery struct {
	Must               []Filter `json:"must,omitempty"`
	Should             []Filter `json:"should,omitempty"`
	MinimumShouldMatch int      `json:"minimum_should_match,omitempty"`
	Boost              float64  `json:"boost,omitempty"`
}

BoolQuery represents a Query API bool object.

type Bucket

type Bucket struct {
	Key         interface{} `json:"key,omitempty"`
	KeyAsString string      `json:"key_as_string,omitempty"`
	DocCount    int         `json:"doc_count,omitempty"`
}

Bucket is an Elasticsearch aggregation response bucket struct.

type CreateIndexBody

type CreateIndexBody struct {
	Index    *Index             `json:"index,omitempty"`
	Settings *Settings          `json:"settings,omitempty"`
	Mappings map[string]Mapping `json:"mappings,omitempty"`
}

type DateHistogram

type DateHistogram struct {
	Field    string `json:"field,omitempty"`
	Interval string `json:"interval,omitempty"`
}

DateHistogram represents the Elasticsearch date_histogram aggregation.

type Filter

type Filter struct {
	Match map[string]string `json:"match,omitempty"`
	Term  map[string]string `json:"term,omitempty"`
	Range map[string]Range  `json:"range,omitempty"`
}

Filter represents a Query API filter object.

type Filtered

type Filtered struct {
	Or FilteredOr `json:"or,omitempty"`
}

Filtered represents a Query API filtered object.

type FilteredOr

type FilteredOr struct {
	Filters []Filter `json:"filters,omitempty"`
	Cache   bool     `json:"_cache,omitempty"`
}

FilteredOr represents a Query API filtered or object.

type Hits

type Hits struct {
	Total int64 `json:"total,omitempty"`
}

type Index

type Index struct {
	NumberOfShards   uint32 `json:"number_of_shards,omitempty"`
	NumberOfReplicas uint32 `json:"number_of_replicas,omitempty"`
}

type Mapping

type Mapping struct {
	All        All                 `json:"_all,omitempty"`
	Properties map[string]Property `json:"properties,omitempty"`
}

type MatchQuery

type MatchQuery struct {
	Query          string `json:"query,omitempty"`
	Operator       string `json:"operator,omitempty"`
	ZeroTermsQuery string `json:"zero_terms_query,omitempty"`
}

MatchQuery represents a Query API match object.

type Nested

type Nested struct {
	Path      string `json:"path,omitempty"`
	ScoreMode string `json:"score_mode,omitempty"`
	Query     *Query `json:"query,omitempty"`
}

Nested indicates whether the aggregation key is a nested key or not. It is mandatory to use a nested key (e.g. a key using dot notation).

type Property

type Property struct {
	Type       string              `json:"type,omitempty"`
	Index      string              `json:"index,omitempty"`
	Format     string              `json:"format,omitempty"`
	Properties map[string]Property `json:"properties,omitempty"`
	Fields     map[string]Property `json:"fields,omitempty"` // key can be "raw"
}

type Query

type Query struct {
	Bool   *BoolQuery            `json:"bool,omitempty"`
	Nested *Nested               `json:"nested,omitempty"`
	Match  map[string]MatchQuery `json:"match,omitempty"`
	Range  map[string]Range      `json:"range,omitempty"`
}

Query represents a Query API query object.

type QueryBody

type QueryBody struct {
	Query Query `json:"query,omitempty"`
}

QueryBody represents a HTTP request body for the Elasticsearch query API.

type Range

type Range struct {
	GT    interface{} `json:"gt,omitempty"`
	GTE   interface{} `json:"gte,omitempty"`
	LT    interface{} `json:"lt,omitempty"`
	LTE   interface{} `json:"lte,omitempty"`
	Boost float32     `json:"boost,omitempty"`
}

type ResponseBody

type ResponseBody struct {
	Hits Hits `json:"hits,omitempty"`
}

type Settings

type Settings struct {
	NumberOfShards int `json:"number_of_shards,omitempty"`
}

type Term

type Term struct {
	Field string `json:"field,omitempty"`
	Null  bool   `json:"null,omitempty"`
}

Term is the field being processed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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