querypara

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AAgg

type AAgg struct {
	Name           string `json:"name"`            // 聚合名
	Key            string `json:"key"`             // 聚合字段
	CollectionMode string `json:"collection_mode"` // depth_first/breadth_first
}

type AMetric

type AMetric struct {
	Sum *AAgg `json:"sum"` // 和
	Avg *AAgg `json:"avg"` // 平均值
	Min *AAgg `json:"min"` // 最小值
	Max *AAgg `json:"max"` // 最大值
}

AMetric 指标聚合

type AOrder

type AOrder struct {
	Name string `json:"name"` // 名称
	Key  string `json:"key"`  // 字段名
	Asc  bool   `json:"asc"`  // 是否升序
}

AOrder 排序

type APipe

type APipe struct {
	Order *AOrder `json:"order"` // 排序
}

APipe 管道聚合:对其它聚合操作的输出以及关联指标进行聚合

type ARange

type ARange struct {
	RStart interface{} `json:"start"` // 开始位置(大于等于)
	REnd   interface{} `json:"end"`   // 结束位置(小于等于)
}

ARange 范围

type ARanges

type ARanges struct {
	Key    string    `json:"key"`    // 字段名
	Ranges []*ARange `json:"ranges"` // 范围
}

ARanges 范围

type ASize

type ASize struct {
	Size int `json:"size"` // 大小
}

ASize 大小

type ASub

type ASub struct {
	Sum      []*AAgg `json:"sum"`      // 和
	Avg      []*AAgg `json:"avg"`      // 平均值
	Min      []*AAgg `json:"min"`      // 最小值
	Max      []*AAgg `json:"max"`      // 最大值
	Pipeline *APipe  `json:"pipeline"` // 管道聚合
	SubAgg   *Agg    `json:"sub_agg"`  // 子组合
}

ASub 对聚合的嵌套操作

type Agg

type Agg struct {
	Name        string   `json:"name"`        // 聚合名
	Cardinality string   `json:"cardinality"` // 去重
	Metric      *AMetric `json:"metric"`      // 指标聚合
	Term        *AAgg    `json:"term"`        // 分桶聚合的Term聚合
	Ranges      *ARanges `json:"ranges"`      // 分桶聚合的Range聚合
	Subs        *ASub    `json:"sub"`         // 对聚合的嵌套操作
	Size        *ASize   `json:"size"`        // 大小
	Order       *AOrder  `json:"order"`       // 排序
}

type QFetch

type QFetch struct {
	FetchSource bool     `json:"fetch_source"` // 是否获取
	Keys        []string `json:"keys"`         // 字段名列表
}

QFetch 获取

type QMatch

type QMatch struct {
	Key      string      `json:"key"`   // 字段名
	Value    interface{} `json:"value"` // 值
	SubQuery *Query      `json:"query"` // 子查询
}

QMatch key

type QMultiMatch

type QMultiMatch struct {
	Keys  []string    `json:"keys"`  // 字段名列表
	Value interface{} `json:"value"` // 值
}

QMultiMatch keys

type QPage

type QPage struct {
	Size   int `json:"size"`   // 大小
	Number int `json:"number"` // 当前页数
}

QPage page

type QRange

type QRange struct {
	Key    string      `json:"key"`   // 字段名
	RStart interface{} `json:"start"` // 大于等于
	REnd   interface{} `json:"end"`   // 小于等于
	GT     interface{} `json:"gt"`    // 大于
	LT     interface{} `json:"lt"`    // 小于
}

QRange range

type QSize

type QSize struct {
	Size int `json:"size"` // 大小
}

type QSort

type QSort struct {
	Key       string `json:"key"`       // 字段名
	Ascending bool   `json:"ascending"` // 是否递增
}

QSort sort

type Query

type Query struct {
	Page       *QPage         `json:"page"`        // 分页
	Size       *QSize         `json:"size"`        // 大小
	Sort       []*QSort       `json:"sort"`        // 排序
	Range      []*QRange      `json:"range"`       // 范围
	Match      []*QMatch      `json:"match"`       // 且匹配
	MatchOne   []*QMatch      `json:"match_one"`   // 或匹配
	MultiMatch []*QMultiMatch `json:"multi_match"` // 多字段匹配
	Filter     []*QMatch      `json:"filter"`      // 过滤
	Not        []*QMatch      `json:"not"`         // 非匹配
	Fetch      *QFetch        `json:"fetch"`       // 获取字段
}

Query queryPara

type Search struct {
	Agg   *Agg   `json:"agg"`   // 聚合
	Query *Query `json:"query"` // 查询
}

Jump to

Keyboard shortcuts

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