search

package
v1.7.14 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 12

Documentation

Index

Constants

View Source
const (
	FirstWhenMissing = "_first"
	LastWhenMissing  = "_last"
)

Variables

View Source
var Inf = math.Inf(1)
View Source
var NegInf = math.Inf(-1)

Functions

func AsBoolean added in v1.7.0

func AsBoolean(bytes []byte) (bool, error)

func AsDouble added in v1.7.0

func AsDouble(bytes []byte) (float64, error)

func AsInteger added in v1.7.0

func AsInteger(bytes []byte) (int64, error)

func AsString added in v1.7.0

func AsString(bytes []byte) (string, error)

func BuildPBForAggregation

func BuildPBForAggregation(a Aggregation) (*otsprotocol.Aggregation, error)

func BuildPBForAggregations

func BuildPBForAggregations(aggs []Aggregation) (*otsprotocol.Aggregations, error)

func BuildPBForGroupBy

func BuildPBForGroupBy(g GroupBy) (*otsprotocol.GroupBy, error)

func BuildPBForGroupBys

func BuildPBForGroupBys(groupBys []GroupBy) (*otsprotocol.GroupBys, error)

func BuildPBForQuery

func BuildPBForQuery(q Query) (*otsprotocol.Query, error)

func BuildPBForRanges

func BuildPBForRanges(ranges []Range) ([]*otsprotocol.Range, error)

func ForceConvertToDestColumnValue added in v1.7.0

func ForceConvertToDestColumnValue(bytes []byte) (*model.ColumnValue, error)

func NewScanQuery added in v1.6.0

func NewScanQuery() *scanQuery

func NewSearchQuery

func NewSearchQuery() *searchQuery

Types

type Aggregation

type Aggregation interface {
	//get agg name
	GetName() string

	//get agg type
	GetType() AggregationType

	//build body, implemented by each concrete agg
	Serialize() ([]byte, error)

	// build the whole aggregation, implemented by each concrete agg,
	// using BuildPBForAggregation() defined in agg interface
	ProtoBuffer() (*otsprotocol.Aggregation, error)
}
message Aggregation {
    optional string name = 1;
    optional AggregationType type = 2;
    optional bytes body = 3;
}

func UnmarshalAggregation added in v1.7.3

func UnmarshalAggregation(name string, data json.RawMessage) (Aggregation, error)

type AggregationResult

type AggregationResult interface {
	GetName() string
	GetType() AggregationType
}

type AggregationResults

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

func ParseAggregationResultsFromPB

func ParseAggregationResultsFromPB(pbAggregationResults []*otsprotocol.AggregationResult) (*AggregationResults, error)

func (AggregationResults) Avg

func (AggregationResults) Count

func (AggregationResults) DistinctCount

func (AggregationResults) Empty

func (a AggregationResults) Empty() bool

func (*AggregationResults) GetRawResults

func (a *AggregationResults) GetRawResults() map[string]AggregationResult

func (AggregationResults) Max

func (AggregationResults) Min

func (AggregationResults) Percentiles added in v1.7.0

func (*AggregationResults) Put

func (a *AggregationResults) Put(name string, result AggregationResult)

func (AggregationResults) Sum

func (AggregationResults) TopRows added in v1.7.0

type AggregationType

type AggregationType int
const (
	AggregationNoneType          AggregationType = 0
	AggregationAvgType           AggregationType = 1
	AggregationDistinctCountType AggregationType = 2
	AggregationMaxType           AggregationType = 3
	AggregationMinType           AggregationType = 4
	AggregationSumType           AggregationType = 5
	AggregationCountType         AggregationType = 6
	AggregationTopRowsType       AggregationType = 7
	AggregationPercentilesType   AggregationType = 8
)

func ToAggregationType added in v1.7.3

func ToAggregationType(q string) AggregationType

func (AggregationType) Enum

func (a AggregationType) Enum() *AggregationType

func (AggregationType) String

func (a AggregationType) String() string

func (AggregationType) ToPB

type AvgAggregation

type AvgAggregation struct {
	AggName      string
	Field        string
	MissingValue interface{}
}

func NewAvgAggregation

func NewAvgAggregation(name string, fieldName string) *AvgAggregation

func (*AvgAggregation) FieldName

func (a *AvgAggregation) FieldName(fieldName string) *AvgAggregation

func (*AvgAggregation) GetName

func (a *AvgAggregation) GetName() string

func (*AvgAggregation) GetType

func (a *AvgAggregation) GetType() AggregationType

func (*AvgAggregation) Missing

func (a *AvgAggregation) Missing(missing interface{}) *AvgAggregation

func (*AvgAggregation) Name

func (a *AvgAggregation) Name(name string) *AvgAggregation

building chain

func (*AvgAggregation) ProtoBuffer

func (a *AvgAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)

func (*AvgAggregation) Serialize

func (a *AvgAggregation) Serialize() ([]byte, error)

type AvgAggregationResult

type AvgAggregationResult struct {
	Name  string
	Value float64 //+inf means missing value
}

func ParseAvgAggregationResultFromPB

func ParseAvgAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*AvgAggregationResult, error)

func (*AvgAggregationResult) GetName

func (a *AvgAggregationResult) GetName() string

func (*AvgAggregationResult) GetType

func (*AvgAggregationResult) HasValue

func (a *AvgAggregationResult) HasValue() bool

type BoolQuery

type BoolQuery struct {
	MustQueries        []Query `json:"-"`
	MustNotQueries     []Query `json:"-"`
	FilterQueries      []Query `json:"-"`
	ShouldQueries      []Query `json:"-"`
	MinimumShouldMatch *int32

	// for json marshal and unmarshal
	MustQueriesAlias    []queryAlias `json:"MustQueries"`
	MustNotQueriesAlias []queryAlias `json:"MustNotQueries"`
	FilterQueriesAlias  []queryAlias `json:"FilterQueries"`
	ShouldQueriesAlias  []queryAlias `json:"ShouldQueries"`
}

func (*BoolQuery) MarshalJSON added in v1.7.3

func (q *BoolQuery) MarshalJSON() ([]byte, error)

func (*BoolQuery) ProtoBuffer

func (q *BoolQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*BoolQuery) Serialize

func (q *BoolQuery) Serialize() ([]byte, error)

func (*BoolQuery) Type

func (q *BoolQuery) Type() QueryType

func (*BoolQuery) UnmarshalJSON added in v1.7.3

func (q *BoolQuery) UnmarshalJSON(data []byte) (err error)

type Collapse

type Collapse struct {
	FieldName string
}

func (*Collapse) ProtoBuffer

func (c *Collapse) ProtoBuffer() (*otsprotocol.Collapse, error)

type CombineMode added in v1.7.12

type CombineMode int32
const (
	CM_MULTIPLY CombineMode = iota
	CM_AVG
	CM_MAX
	CM_SUM
	CM_MIN
	CM_REPLACE
)

func (CombineMode) Enum added in v1.7.12

func (m CombineMode) Enum() *CombineMode

func (*CombineMode) ProtoBuffer added in v1.7.12

func (m *CombineMode) ProtoBuffer() *otsprotocol.FunctionCombineMode

type ConstScoreQuery

type ConstScoreQuery struct {
	Filter Query `json:"-"`

	// for json marshal and unmarshal
	FilterAlias queryAlias `json:"Filter"`
}

func (*ConstScoreQuery) MarshalJSON added in v1.7.3

func (q *ConstScoreQuery) MarshalJSON() ([]byte, error)

func (*ConstScoreQuery) ProtoBuffer

func (q *ConstScoreQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*ConstScoreQuery) Serialize

func (q *ConstScoreQuery) Serialize() ([]byte, error)

func (*ConstScoreQuery) Type

func (q *ConstScoreQuery) Type() QueryType

func (*ConstScoreQuery) UnmarshalJSON added in v1.7.3

func (q *ConstScoreQuery) UnmarshalJSON(data []byte) (err error)

type CountAggregation

type CountAggregation struct {
	AggName string
	Field   string
}

func NewCountAggregation

func NewCountAggregation(name string, fieldName string) *CountAggregation

func (*CountAggregation) FieldName

func (a *CountAggregation) FieldName(fieldName string) *CountAggregation

func (*CountAggregation) GetName

func (a *CountAggregation) GetName() string

func (*CountAggregation) GetType

func (a *CountAggregation) GetType() AggregationType

func (*CountAggregation) Name

func (a *CountAggregation) Name(name string) *CountAggregation

building chain

func (*CountAggregation) ProtoBuffer

func (a *CountAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)

func (*CountAggregation) Serialize

func (a *CountAggregation) Serialize() ([]byte, error)

type CountAggregationResult

type CountAggregationResult struct {
	Name  string
	Value int64
}

func ParseCountAggregationResultFromPB

func ParseCountAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*CountAggregationResult, error)

func (*CountAggregationResult) GetName

func (a *CountAggregationResult) GetName() string

func (*CountAggregationResult) GetType

type DecayFuncDateParam added in v1.7.12

type DecayFuncDateParam struct {
	OriginLong   *int64
	OriginString *string
	Scale        *model.DateTimeValue
	Offset       *model.DateTimeValue
}

func NewDecayFuncDateParam added in v1.7.12

func NewDecayFuncDateParam() *DecayFuncDateParam

func (*DecayFuncDateParam) GetType added in v1.7.12

func (p *DecayFuncDateParam) GetType() ParamType

func (*DecayFuncDateParam) ProtoBuffer added in v1.7.12

func (*DecayFuncDateParam) SetOffset added in v1.7.12

func (*DecayFuncDateParam) SetOriginLong added in v1.7.12

func (p *DecayFuncDateParam) SetOriginLong(origin int64) *DecayFuncDateParam

func (*DecayFuncDateParam) SetOriginString added in v1.7.12

func (p *DecayFuncDateParam) SetOriginString(origin string) *DecayFuncDateParam

func (*DecayFuncDateParam) SetScale added in v1.7.12

type DecayFuncGeoParam added in v1.7.12

type DecayFuncGeoParam struct {
	Origin *string
	Scale  *float64
	Offset *float64
}

func NewDecayFuncGeoParam added in v1.7.12

func NewDecayFuncGeoParam() *DecayFuncGeoParam

func (*DecayFuncGeoParam) GetType added in v1.7.12

func (p *DecayFuncGeoParam) GetType() ParamType

func (*DecayFuncGeoParam) ProtoBuffer added in v1.7.12

func (*DecayFuncGeoParam) SetOffset added in v1.7.12

func (p *DecayFuncGeoParam) SetOffset(value float64) *DecayFuncGeoParam

func (*DecayFuncGeoParam) SetOrigin added in v1.7.12

func (p *DecayFuncGeoParam) SetOrigin(origin string) *DecayFuncGeoParam

func (*DecayFuncGeoParam) SetScale added in v1.7.12

func (p *DecayFuncGeoParam) SetScale(value float64) *DecayFuncGeoParam

type DecayFuncNumericParam added in v1.7.12

type DecayFuncNumericParam struct {
	Origin *float64
	Scale  *float64
	Offset *float64
}

func NewDecayFuncNumericParam added in v1.7.12

func NewDecayFuncNumericParam() *DecayFuncNumericParam

func (*DecayFuncNumericParam) GetType added in v1.7.12

func (p *DecayFuncNumericParam) GetType() ParamType

func (*DecayFuncNumericParam) ProtoBuffer added in v1.7.12

func (*DecayFuncNumericParam) SetOffset added in v1.7.12

func (*DecayFuncNumericParam) SetOrigin added in v1.7.12

func (p *DecayFuncNumericParam) SetOrigin(origin float64) *DecayFuncNumericParam

func (*DecayFuncNumericParam) SetScale added in v1.7.12

type DecayFunction added in v1.7.12

type DecayFunction struct {
	FieldName      *string
	ParamType      ParamType  `json:"ParamType"`
	DecayParam     DecayParam `json:"DecayParam"`
	MathFunction   *MathFunction
	Decay          *float64
	MultiValueMode *MultiValueMode
}

func NewDecayFunction added in v1.7.12

func NewDecayFunction() *DecayFunction

func (*DecayFunction) ProtoBuffer added in v1.7.12

func (f *DecayFunction) ProtoBuffer() (*otsprotocol.DecayFunction, error)

func (*DecayFunction) SetDecay added in v1.7.12

func (f *DecayFunction) SetDecay(decay float64) *DecayFunction

func (*DecayFunction) SetDecayParam added in v1.7.12

func (f *DecayFunction) SetDecayParam(param DecayParam) *DecayFunction

func (*DecayFunction) SetFieldName added in v1.7.12

func (f *DecayFunction) SetFieldName(name string) *DecayFunction

func (*DecayFunction) SetMathFunction added in v1.7.12

func (f *DecayFunction) SetMathFunction(function MathFunction) *DecayFunction

func (*DecayFunction) SetMultiValueMode added in v1.7.12

func (f *DecayFunction) SetMultiValueMode(mode MultiValueMode) *DecayFunction

type DecayParam added in v1.7.12

type DecayParam interface {
	GetType() ParamType
}

type DistinctCountAggregation

type DistinctCountAggregation struct {
	AggName      string
	Field        string
	MissingValue interface{}
}

func NewDistinctCountAggregation

func NewDistinctCountAggregation(name string, fieldName string) *DistinctCountAggregation

func (*DistinctCountAggregation) FieldName

func (a *DistinctCountAggregation) FieldName(fieldName string) *DistinctCountAggregation

func (*DistinctCountAggregation) GetName

func (a *DistinctCountAggregation) GetName() string

func (*DistinctCountAggregation) GetType

func (*DistinctCountAggregation) Missing

func (a *DistinctCountAggregation) Missing(missing interface{}) *DistinctCountAggregation

func (*DistinctCountAggregation) Name

building chain

func (*DistinctCountAggregation) ProtoBuffer

func (*DistinctCountAggregation) Serialize

func (a *DistinctCountAggregation) Serialize() ([]byte, error)

type DistinctCountAggregationResult

type DistinctCountAggregationResult struct {
	Name  string
	Value int64
}

func ParseDistinctCountAggregationResultFromPB

func ParseDistinctCountAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*DistinctCountAggregationResult, error)

func (*DistinctCountAggregationResult) GetName

func (*DistinctCountAggregationResult) GetType

type DocSort added in v1.7.12

type DocSort struct {
	SortOrder *SortOrder
}

func (*DocSort) ProtoBuffer added in v1.7.12

func (docSort *DocSort) ProtoBuffer() (sorter *otsprotocol.Sorter, err error)

type ExistsQuery

type ExistsQuery struct {
	FieldName string
}

func (*ExistsQuery) ProtoBuffer

func (q *ExistsQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*ExistsQuery) Serialize

func (q *ExistsQuery) Serialize() ([]byte, error)

func (*ExistsQuery) Type

func (q *ExistsQuery) Type() QueryType

type FieldSort

type FieldSort struct {
	FieldName    string
	Order        *SortOrder
	Mode         *SortMode
	NestedFilter *NestedFilter
	MissingValue interface{} // 当排序的字段某些行没有填充值时,排序行为支持三种方式:1、设置为FirstWhenMissing,当排序字段值缺省时候排在最前面;2、设置为LastWhenMissing,当排序字段值缺省时候排在最后面;3、自定义值,当排序字段值缺省时候使用指定的值进行排序。
	MissingField *string
}

func NewFieldSort

func NewFieldSort(fieldName string, order SortOrder) *FieldSort

func (*FieldSort) ProtoBuffer

func (s *FieldSort) ProtoBuffer() (*otsprotocol.Sorter, error)

type FieldValueFactor

type FieldValueFactor struct {
	FieldName string
}

func (*FieldValueFactor) ProtoBuffer

func (f *FieldValueFactor) ProtoBuffer() (*otsprotocol.FieldValueFactor, error)

type FieldValueFactorFunction added in v1.7.12

type FieldValueFactorFunction struct {
	FieldName *string
	Factor    *float32
	Modifier  *FunctionModifier
	Missing   *float64
}

func NewFieldValueFactorFunction added in v1.7.12

func NewFieldValueFactorFunction() *FieldValueFactorFunction

func (*FieldValueFactorFunction) ProtoBuffer added in v1.7.12

func (*FieldValueFactorFunction) SetFactor added in v1.7.12

func (*FieldValueFactorFunction) SetFieldName added in v1.7.12

func (*FieldValueFactorFunction) SetFunctionModifier added in v1.7.12

func (f *FieldValueFactorFunction) SetFunctionModifier(modifier FunctionModifier) *FieldValueFactorFunction

func (*FieldValueFactorFunction) SetMissing added in v1.7.12

type FunctionModifier added in v1.7.12

type FunctionModifier int32
const (
	// NONE 不做额外运算
	NONE FunctionModifier = iota
	// LOG 取10为底对数运算
	LOG
	// LOG1P 对真数加1后取10为底对数,防止真数为0
	LOG1P
	// LOG2P 对真数加2后取10为底对数,防止真数为0
	LOG2P
	// LN 取e为底对数运算
	LN
	// LN1P 对真数加1后取e为底对数,防止真数为0
	LN1P
	// LN2P 对真数加2后取e为底对数,防止真数为0
	LN2P
	// SQUARE 平方运算
	SQUARE
	// SQRT 开方运算
	SQRT
	// RECIPROCAL 倒数运算
	RECIPROCAL
)

func (FunctionModifier) Enum added in v1.7.12

func (*FunctionModifier) ProtoBuffer added in v1.7.12

func (m *FunctionModifier) ProtoBuffer() *otsprotocol.FunctionModifier

type FunctionScoreQuery

type FunctionScoreQuery struct {
	Query            Query `json:"-"`
	FieldValueFactor *FieldValueFactor

	// for json marshal and unmarshal
	QueryAlias queryAlias `json:"Query"`
}

Deprecated 请使用 FunctionsScoreQuery 代替

func (*FunctionScoreQuery) MarshalJSON added in v1.7.3

func (q *FunctionScoreQuery) MarshalJSON() ([]byte, error)

func (*FunctionScoreQuery) ProtoBuffer

func (q *FunctionScoreQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*FunctionScoreQuery) Serialize

func (q *FunctionScoreQuery) Serialize() ([]byte, error)

func (*FunctionScoreQuery) Type

func (q *FunctionScoreQuery) Type() QueryType

func (*FunctionScoreQuery) UnmarshalJSON added in v1.7.3

func (q *FunctionScoreQuery) UnmarshalJSON(data []byte) (err error)

type FunctionsScoreQuery added in v1.7.12

type FunctionsScoreQuery struct {
	Query       Query            `json:"-"`
	Functions   []*ScoreFunction `json:"-"`
	ScoreMode   *ScoreMode       `json:"-"`
	CombineMode *CombineMode     `json:"-"`
	MinScore    *float32         `json:"-"`
	MaxScore    *float32         `json:"-"`
	// for json marshal and unmarshal
	QueryAlias queryAlias `json:"Query"`
}

func NewFunctionsScoreQuery added in v1.7.12

func NewFunctionsScoreQuery() *FunctionsScoreQuery

func (*FunctionsScoreQuery) AddFunction added in v1.7.12

func (q *FunctionsScoreQuery) AddFunction(function *ScoreFunction) *FunctionsScoreQuery

func (*FunctionsScoreQuery) MarshalJSON added in v1.7.12

func (q *FunctionsScoreQuery) MarshalJSON() ([]byte, error)

func (*FunctionsScoreQuery) ProtoBuffer added in v1.7.12

func (q *FunctionsScoreQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*FunctionsScoreQuery) Serialize added in v1.7.12

func (q *FunctionsScoreQuery) Serialize() ([]byte, error)

func (*FunctionsScoreQuery) SetCombineMode added in v1.7.12

func (q *FunctionsScoreQuery) SetCombineMode(mode CombineMode) *FunctionsScoreQuery

func (*FunctionsScoreQuery) SetFunctions added in v1.7.12

func (q *FunctionsScoreQuery) SetFunctions(functions []*ScoreFunction) *FunctionsScoreQuery

func (*FunctionsScoreQuery) SetMaxScore added in v1.7.12

func (q *FunctionsScoreQuery) SetMaxScore(maxScore float32) *FunctionsScoreQuery

func (*FunctionsScoreQuery) SetMinScore added in v1.7.12

func (q *FunctionsScoreQuery) SetMinScore(minScore float32) *FunctionsScoreQuery

func (*FunctionsScoreQuery) SetQuery added in v1.7.12

func (q *FunctionsScoreQuery) SetQuery(query Query) *FunctionsScoreQuery

func (*FunctionsScoreQuery) SetScoreMode added in v1.7.12

func (q *FunctionsScoreQuery) SetScoreMode(mode ScoreMode) *FunctionsScoreQuery

func (*FunctionsScoreQuery) Type added in v1.7.12

func (q *FunctionsScoreQuery) Type() QueryType

func (*FunctionsScoreQuery) UnmarshalJSON added in v1.7.12

func (q *FunctionsScoreQuery) UnmarshalJSON(data []byte) (err error)

type GeoBoundingBoxQuery

type GeoBoundingBoxQuery struct {
	FieldName   string
	TopLeft     string
	BottomRight string
}

func (*GeoBoundingBoxQuery) ProtoBuffer

func (q *GeoBoundingBoxQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*GeoBoundingBoxQuery) Serialize

func (q *GeoBoundingBoxQuery) Serialize() ([]byte, error)

func (*GeoBoundingBoxQuery) Type

func (q *GeoBoundingBoxQuery) Type() QueryType

type GeoDistanceQuery

type GeoDistanceQuery struct {
	FieldName       string
	CenterPoint     string
	DistanceInMeter float64
}

func (*GeoDistanceQuery) ProtoBuffer

func (q *GeoDistanceQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*GeoDistanceQuery) Serialize

func (q *GeoDistanceQuery) Serialize() ([]byte, error)

func (*GeoDistanceQuery) Type

func (q *GeoDistanceQuery) Type() QueryType

type GeoDistanceSort

type GeoDistanceSort struct {
	FieldName       string
	Points          []string
	Order           *SortOrder
	Mode            *SortMode
	GeoDistanceType *GeoDistanceType
	NestedFilter    *NestedFilter
}

func (*GeoDistanceSort) ProtoBuffer

func (s *GeoDistanceSort) ProtoBuffer() (*otsprotocol.Sorter, error)

type GeoDistanceType

type GeoDistanceType int8
const (
	GeoDistanceType_ARC   GeoDistanceType = 0
	GeoDistanceType_PLANE GeoDistanceType = 1
)

func ToGeoDistanceType added in v1.7.3

func ToGeoDistanceType(t string) (GeoDistanceType, error)

func (*GeoDistanceType) MarshalJSON added in v1.7.3

func (op *GeoDistanceType) MarshalJSON() (data []byte, err error)

func (*GeoDistanceType) ProtoBuffer

func (t *GeoDistanceType) ProtoBuffer() (*otsprotocol.GeoDistanceType, error)

func (GeoDistanceType) String added in v1.7.3

func (t GeoDistanceType) String() string

func (*GeoDistanceType) UnmarshalJSON added in v1.7.3

func (t *GeoDistanceType) UnmarshalJSON(data []byte) (err error)

type GeoGrid added in v1.7.12

type GeoGrid struct {
	TopLeft     GeoPoint
	BottomRight GeoPoint
}

GeoGrid 表示地球上的一个区域,它包含一个 TopLeft 和一个 BottomRight 。 TopLeft 和 BottomRight 组合成一个网格,所以 TopLeft 的 lat 应该大于 BottomRight 的 lat, TopLeft 的 lon 应该小于 BottomRight 的 lat。

type GeoPoint

type GeoPoint struct {
	Lat float64 //[-90, 90]
	Lon float64 //[-180, 180]
}

type GeoPolygonQuery

type GeoPolygonQuery struct {
	FieldName string
	Points    []string
}

func (*GeoPolygonQuery) ProtoBuffer

func (q *GeoPolygonQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*GeoPolygonQuery) Serialize

func (q *GeoPolygonQuery) Serialize() ([]byte, error)

func (*GeoPolygonQuery) Type

func (q *GeoPolygonQuery) Type() QueryType

type GroupBy

type GroupBy interface {
	//get group by name
	GetName() string

	//get group by type
	GetType() GroupByType

	//build body, implemented by each concrete agg
	Serialize() ([]byte, error)

	// build the whole aggregation, implemented by each concrete agg,
	// using BuildPBForAggregation() defined in agg interface
	ProtoBuffer() (*otsprotocol.GroupBy, error)
}
	message GroupBy {
    	optional string name = 1;
    	optional GroupByType type = 2;
    	optional bytes body = 3;
	}

type GroupByDateHistogram added in v1.7.10

type GroupByDateHistogram struct {
	GroupByName string

	Field       string
	Interval    model.DateTimeValue
	FieldRange  model.FiledRange
	Missing     interface{}
	MinDocCount *int64
	TimeZone    *string
	Sorters     []GroupBySorter

	SubAggList     []Aggregation
	SubGroupByList []GroupBy
}

func NewGroupByDateHistogram added in v1.7.10

func NewGroupByDateHistogram(name string, filedName string) *GroupByDateHistogram

func (*GroupByDateHistogram) GetField added in v1.7.10

func (g *GroupByDateHistogram) GetField() string

func (*GroupByDateHistogram) GetInterval added in v1.7.10

func (g *GroupByDateHistogram) GetInterval() model.DateTimeValue

func (*GroupByDateHistogram) GetMinDocCount added in v1.7.10

func (g *GroupByDateHistogram) GetMinDocCount() *int64

func (*GroupByDateHistogram) GetName added in v1.7.10

func (g *GroupByDateHistogram) GetName() string

func (*GroupByDateHistogram) GetTimeZone added in v1.7.10

func (g *GroupByDateHistogram) GetTimeZone() *string

func (*GroupByDateHistogram) GetType added in v1.7.10

func (g *GroupByDateHistogram) GetType() GroupByType

func (*GroupByDateHistogram) ProtoBuffer added in v1.7.10

func (g *GroupByDateHistogram) ProtoBuffer() (*otsprotocol.GroupBy, error)

func (*GroupByDateHistogram) Serialize added in v1.7.10

func (g *GroupByDateHistogram) Serialize() ([]byte, error)

func (*GroupByDateHistogram) SetFieldName added in v1.7.10

func (g *GroupByDateHistogram) SetFieldName(fieldName string) *GroupByDateHistogram

func (*GroupByDateHistogram) SetFiledRange added in v1.7.10

func (g *GroupByDateHistogram) SetFiledRange(min interface{}, max interface{}) *GroupByDateHistogram

func (*GroupByDateHistogram) SetGroupBySorters added in v1.7.10

func (g *GroupByDateHistogram) SetGroupBySorters(sorters []GroupBySorter) *GroupByDateHistogram

func (*GroupByDateHistogram) SetInterval added in v1.7.10

func (*GroupByDateHistogram) SetMinDocCount added in v1.7.10

func (g *GroupByDateHistogram) SetMinDocCount(minDocCount int64) *GroupByDateHistogram

func (*GroupByDateHistogram) SetMissing added in v1.7.10

func (g *GroupByDateHistogram) SetMissing(missing interface{}) *GroupByDateHistogram

func (*GroupByDateHistogram) SetName added in v1.7.10

func (*GroupByDateHistogram) SetTimeZone added in v1.7.10

func (g *GroupByDateHistogram) SetTimeZone(timeZone string) *GroupByDateHistogram

func (*GroupByDateHistogram) SubAggregation added in v1.7.10

func (g *GroupByDateHistogram) SubAggregation(subAggregation Aggregation) *GroupByDateHistogram

func (*GroupByDateHistogram) SubAggregations added in v1.7.10

func (g *GroupByDateHistogram) SubAggregations(subAggregations ...Aggregation) *GroupByDateHistogram

func (*GroupByDateHistogram) SubGroupBy added in v1.7.10

func (g *GroupByDateHistogram) SubGroupBy(subGroupBy GroupBy) *GroupByDateHistogram

func (*GroupByDateHistogram) SubGroupBys added in v1.7.10

func (g *GroupByDateHistogram) SubGroupBys(subGroupBys ...GroupBy) *GroupByDateHistogram

type GroupByDateHistogramItem added in v1.7.10

type GroupByDateHistogramItem struct {
	Timestamp int64
	RowCount  int64

	SubAggregations AggregationResults
	SubGroupBys     GroupByResults
}

type GroupByDateHistogramResult added in v1.7.10

type GroupByDateHistogramResult struct {
	Name  string
	Items []GroupByDateHistogramItem
}

func ParseGroupByDateHistogramResultFromPB added in v1.7.10

func ParseGroupByDateHistogramResultFromPB(pbGroupByResult *otsprotocol.GroupByResult) (*GroupByDateHistogramResult, error)

func (*GroupByDateHistogramResult) GetName added in v1.7.10

func (g *GroupByDateHistogramResult) GetName() string

func (*GroupByDateHistogramResult) GetType added in v1.7.10

type GroupByField

type GroupByField struct {
	AggName string

	Field   string
	Sz      *int32
	Sorters []GroupBySorter

	SubAggList     []Aggregation
	SubGroupByList []GroupBy
}

func NewGroupByField

func NewGroupByField(name string, fieldName string) *GroupByField

func (*GroupByField) FieldName

func (g *GroupByField) FieldName(fieldName string) *GroupByField

func (*GroupByField) GetName

func (g *GroupByField) GetName() string

func (*GroupByField) GetType

func (g *GroupByField) GetType() GroupByType

func (*GroupByField) GroupBySorters

func (g *GroupByField) GroupBySorters(sorters []GroupBySorter) *GroupByField

func (*GroupByField) Name

func (g *GroupByField) Name(name string) *GroupByField

func (*GroupByField) ProtoBuffer

func (g *GroupByField) ProtoBuffer() (*otsprotocol.GroupBy, error)

func (*GroupByField) Serialize

func (g *GroupByField) Serialize() ([]byte, error)

func (*GroupByField) Size

func (g *GroupByField) Size(size int32) *GroupByField

func (*GroupByField) SubAggregation

func (g *GroupByField) SubAggregation(subAggregation Aggregation) *GroupByField

func (*GroupByField) SubAggregations

func (g *GroupByField) SubAggregations(subAggregations ...Aggregation) *GroupByField

func (*GroupByField) SubGroupBy

func (g *GroupByField) SubGroupBy(subGroupBy GroupBy) *GroupByField

func (*GroupByField) SubGroupBys

func (g *GroupByField) SubGroupBys(subGroupBys ...GroupBy) *GroupByField

type GroupByFieldResult

type GroupByFieldResult struct {
	Name  string
	Items []GroupByFieldResultItem
}

func ParseGroupByFieldResultFromPB

func ParseGroupByFieldResultFromPB(pbGroupByResult *otsprotocol.GroupByResult) (*GroupByFieldResult, error)

func (*GroupByFieldResult) GetName

func (g *GroupByFieldResult) GetName() string

func (*GroupByFieldResult) GetType

func (g *GroupByFieldResult) GetType() GroupByType

type GroupByFieldResultItem

type GroupByFieldResultItem struct {
	Key             string
	RowCount        int64
	SubAggregations AggregationResults
	SubGroupBys     GroupByResults
}

type GroupByFilter

type GroupByFilter struct {
	AggName string

	Queries []Query

	SubAggList     []Aggregation
	SubGroupByList []GroupBy
}

func NewGroupByFilter

func NewGroupByFilter(name string) *GroupByFilter

func (*GroupByFilter) GetName

func (g *GroupByFilter) GetName() string

func (*GroupByFilter) GetType

func (g *GroupByFilter) GetType() GroupByType

func (*GroupByFilter) Name

func (g *GroupByFilter) Name(name string) *GroupByFilter

func (*GroupByFilter) ProtoBuffer

func (g *GroupByFilter) ProtoBuffer() (*otsprotocol.GroupBy, error)

func (*GroupByFilter) Query

func (g *GroupByFilter) Query(query Query) *GroupByFilter

func (*GroupByFilter) Serialize

func (g *GroupByFilter) Serialize() ([]byte, error)

func (*GroupByFilter) SubAggregation

func (g *GroupByFilter) SubAggregation(subAggregation Aggregation) *GroupByFilter

func (*GroupByFilter) SubAggregations

func (g *GroupByFilter) SubAggregations(subAggregations ...Aggregation) *GroupByFilter

func (*GroupByFilter) SubGroupBy

func (g *GroupByFilter) SubGroupBy(subGroupBy GroupBy) *GroupByFilter

func (*GroupByFilter) SubGroupBys

func (g *GroupByFilter) SubGroupBys(subGroupBys ...GroupBy) *GroupByFilter

type GroupByFilterResult

type GroupByFilterResult struct {
	Name  string
	Items []GroupByFilterResultItem
}

func ParseGroupByFilterResultFromPB

func ParseGroupByFilterResultFromPB(pbGroupByResult *otsprotocol.GroupByResult) (*GroupByFilterResult, error)

func (*GroupByFilterResult) GetName

func (g *GroupByFilterResult) GetName() string

func (*GroupByFilterResult) GetType

func (g *GroupByFilterResult) GetType() GroupByType

type GroupByFilterResultItem

type GroupByFilterResultItem struct {
	RowCount        int64
	SubAggregations AggregationResults
	SubGroupBys     GroupByResults
}

type GroupByGeoDistance

type GroupByGeoDistance struct {
	AggName string

	Field     string
	Origin    GeoPoint
	RangeList []Range

	SubAggList     []Aggregation
	SubGroupByList []GroupBy
}

func NewGroupByGeoDistance

func NewGroupByGeoDistance(name string, fieldName string, origin GeoPoint) *GroupByGeoDistance

func (*GroupByGeoDistance) CenterPoint

func (g *GroupByGeoDistance) CenterPoint(latitude float64, longitude float64) *GroupByGeoDistance

func (*GroupByGeoDistance) FieldName

func (g *GroupByGeoDistance) FieldName(fieldName string) *GroupByGeoDistance

func (*GroupByGeoDistance) GetName

func (g *GroupByGeoDistance) GetName() string

func (*GroupByGeoDistance) GetType

func (g *GroupByGeoDistance) GetType() GroupByType

func (*GroupByGeoDistance) Name

func (*GroupByGeoDistance) ProtoBuffer

func (g *GroupByGeoDistance) ProtoBuffer() (*otsprotocol.GroupBy, error)

func (*GroupByGeoDistance) Range

func (g *GroupByGeoDistance) Range(fromInclusive float64, toExclusive float64) *GroupByGeoDistance

append a Range[from, to)

func (*GroupByGeoDistance) Serialize

func (g *GroupByGeoDistance) Serialize() ([]byte, error)

func (*GroupByGeoDistance) SubAggregation

func (g *GroupByGeoDistance) SubAggregation(subAggregation Aggregation) *GroupByGeoDistance

func (*GroupByGeoDistance) SubAggregations

func (g *GroupByGeoDistance) SubAggregations(subAggregations ...Aggregation) *GroupByGeoDistance

func (*GroupByGeoDistance) SubGroupBy

func (g *GroupByGeoDistance) SubGroupBy(subGroupBy GroupBy) *GroupByGeoDistance

func (*GroupByGeoDistance) SubGroupBys

func (g *GroupByGeoDistance) SubGroupBys(subGroupBys ...GroupBy) *GroupByGeoDistance

type GroupByGeoDistanceResult

type GroupByGeoDistanceResult struct {
	Name  string
	Items []GroupByGeoDistanceResultItem
}

func ParseGroupByGeoDistanceResultFromPB

func ParseGroupByGeoDistanceResultFromPB(pbGroupByResult *otsprotocol.GroupByResult) (*GroupByGeoDistanceResult, error)

func (*GroupByGeoDistanceResult) GetName

func (g *GroupByGeoDistanceResult) GetName() string

func (*GroupByGeoDistanceResult) GetType

type GroupByGeoDistanceResultItem

type GroupByGeoDistanceResultItem struct {
	RowCount int64
	From     float64
	To       float64

	SubAggregations AggregationResults
	SubGroupBys     GroupByResults
}

type GroupByGeoGrid added in v1.7.12

type GroupByGeoGrid struct {
	GroupByName string

	Field     string
	Precision model.GeoHashPrecision
	Size      int64

	SubAggList     []Aggregation
	SubGroupByList []GroupBy
}

GroupByGeoGrid 对GeoPoint类型的字段按照地理区域进行分组统计

func NewGroupByGeoGrid added in v1.7.12

func NewGroupByGeoGrid(name string, fieldName string) *GroupByGeoGrid

func (*GroupByGeoGrid) GetField added in v1.7.12

func (g *GroupByGeoGrid) GetField() string

func (*GroupByGeoGrid) GetName added in v1.7.12

func (g *GroupByGeoGrid) GetName() string

func (*GroupByGeoGrid) GetPrecision added in v1.7.12

func (g *GroupByGeoGrid) GetPrecision() model.GeoHashPrecision

func (*GroupByGeoGrid) GetSize added in v1.7.12

func (g *GroupByGeoGrid) GetSize() int64

func (*GroupByGeoGrid) GetType added in v1.7.12

func (g *GroupByGeoGrid) GetType() GroupByType

func (*GroupByGeoGrid) ProtoBuffer added in v1.7.12

func (g *GroupByGeoGrid) ProtoBuffer() (*otsprotocol.GroupBy, error)

func (*GroupByGeoGrid) Serialize added in v1.7.12

func (g *GroupByGeoGrid) Serialize() ([]byte, error)

func (*GroupByGeoGrid) SetField added in v1.7.12

func (g *GroupByGeoGrid) SetField(fieldName string) *GroupByGeoGrid

func (*GroupByGeoGrid) SetGroupByName added in v1.7.12

func (g *GroupByGeoGrid) SetGroupByName(name string) *GroupByGeoGrid

func (*GroupByGeoGrid) SetPrecision added in v1.7.12

func (g *GroupByGeoGrid) SetPrecision(precision model.GeoHashPrecision) *GroupByGeoGrid

func (*GroupByGeoGrid) SetSize added in v1.7.12

func (g *GroupByGeoGrid) SetSize(size int64) *GroupByGeoGrid

func (*GroupByGeoGrid) SubAggregation added in v1.7.12

func (g *GroupByGeoGrid) SubAggregation(subAggregation Aggregation) *GroupByGeoGrid

func (*GroupByGeoGrid) SubAggregations added in v1.7.12

func (g *GroupByGeoGrid) SubAggregations(subAggregations ...Aggregation) *GroupByGeoGrid

func (*GroupByGeoGrid) SubGroupBy added in v1.7.12

func (g *GroupByGeoGrid) SubGroupBy(subGroupBy GroupBy) *GroupByGeoGrid

func (*GroupByGeoGrid) SubGroupBys added in v1.7.12

func (g *GroupByGeoGrid) SubGroupBys(subGroupBys ...GroupBy) *GroupByGeoGrid

type GroupByGeoGridResult added in v1.7.12

type GroupByGeoGridResult struct {
	Name  string
	Items []GroupByGeoGridResultItem
}

func ParseGroupByGeoGridResultFromPB added in v1.7.12

func ParseGroupByGeoGridResultFromPB(pbGroupByResult *otsprotocol.GroupByResult) (*GroupByGeoGridResult, error)

func (*GroupByGeoGridResult) GetName added in v1.7.12

func (g *GroupByGeoGridResult) GetName() string

func (*GroupByGeoGridResult) GetType added in v1.7.12

func (g *GroupByGeoGridResult) GetType() GroupByType

type GroupByGeoGridResultItem added in v1.7.12

type GroupByGeoGridResultItem struct {
	Key      string
	GeoGrid  GeoGrid
	RowCount int64

	SubAggregations AggregationResults
	SubGroupBys     GroupByResults
}

type GroupByHistogram added in v1.7.0

type GroupByHistogram struct {
	GroupByName string

	Field       string
	Interval    interface{}
	Missing     interface{}
	MinDocCount *int64
	FieldRange  model.FiledRange
	Sorters     []GroupBySorter

	SubAggList     []Aggregation
	SubGroupByList []GroupBy
}

func NewGroupByHistogram added in v1.7.0

func NewGroupByHistogram(name string, filedName string) *GroupByHistogram

func (*GroupByHistogram) GetField added in v1.7.0

func (g *GroupByHistogram) GetField() string

func (*GroupByHistogram) GetName added in v1.7.0

func (g *GroupByHistogram) GetName() string

func (*GroupByHistogram) GetType added in v1.7.0

func (g *GroupByHistogram) GetType() GroupByType

func (*GroupByHistogram) ProtoBuffer added in v1.7.0

func (g *GroupByHistogram) ProtoBuffer() (*otsprotocol.GroupBy, error)

func (*GroupByHistogram) Serialize added in v1.7.0

func (g *GroupByHistogram) Serialize() ([]byte, error)

func (*GroupByHistogram) SetFieldName added in v1.7.0

func (g *GroupByHistogram) SetFieldName(fieldName string) *GroupByHistogram

func (*GroupByHistogram) SetFiledRange added in v1.7.0

func (g *GroupByHistogram) SetFiledRange(min interface{}, max interface{}) *GroupByHistogram

func (*GroupByHistogram) SetGroupBySorters added in v1.7.0

func (g *GroupByHistogram) SetGroupBySorters(sorters []GroupBySorter) *GroupByHistogram

func (*GroupByHistogram) SetInterval added in v1.7.0

func (g *GroupByHistogram) SetInterval(interval interface{}) *GroupByHistogram

func (*GroupByHistogram) SetMinDocCount added in v1.7.0

func (g *GroupByHistogram) SetMinDocCount(minDocCount int64) *GroupByHistogram

func (*GroupByHistogram) SetMissing added in v1.7.0

func (g *GroupByHistogram) SetMissing(missing interface{}) *GroupByHistogram

func (*GroupByHistogram) SetName added in v1.7.0

func (g *GroupByHistogram) SetName(name string) *GroupByHistogram

func (*GroupByHistogram) SubAggregation added in v1.7.0

func (g *GroupByHistogram) SubAggregation(subAggregation Aggregation) *GroupByHistogram

func (*GroupByHistogram) SubAggregations added in v1.7.0

func (g *GroupByHistogram) SubAggregations(subAggregations ...Aggregation) *GroupByHistogram

func (*GroupByHistogram) SubGroupBy added in v1.7.0

func (g *GroupByHistogram) SubGroupBy(subGroupBy GroupBy) *GroupByHistogram

func (*GroupByHistogram) SubGroupBys added in v1.7.0

func (g *GroupByHistogram) SubGroupBys(subGroupBys ...GroupBy) *GroupByHistogram

type GroupByHistogramItem added in v1.7.0

type GroupByHistogramItem struct {
	Key   model.ColumnValue
	Value int64

	SubAggregations AggregationResults
	SubGroupBys     GroupByResults
}

type GroupByHistogramResult added in v1.7.0

type GroupByHistogramResult struct {
	Name  string
	Items []GroupByHistogramItem
}

func ParseGroupByHistogramResultFromPB added in v1.7.0

func ParseGroupByHistogramResultFromPB(pbGroupByResult *otsprotocol.GroupByResult) (*GroupByHistogramResult, error)

func (*GroupByHistogramResult) GetName added in v1.7.0

func (g *GroupByHistogramResult) GetName() string

func (*GroupByHistogramResult) GetType added in v1.7.0

func (g *GroupByHistogramResult) GetType() GroupByType

type GroupByRange

type GroupByRange struct {
	AggName string

	Field     string
	RangeList []Range

	SubAggList     []Aggregation
	SubGroupByList []GroupBy
}

func NewGroupByRange

func NewGroupByRange(name string, fieldName string) *GroupByRange

func (*GroupByRange) FieldName

func (g *GroupByRange) FieldName(fieldName string) *GroupByRange

func (*GroupByRange) GetName

func (g *GroupByRange) GetName() string

func (*GroupByRange) GetType

func (g *GroupByRange) GetType() GroupByType

func (*GroupByRange) Name

func (g *GroupByRange) Name(name string) *GroupByRange

func (*GroupByRange) ProtoBuffer

func (g *GroupByRange) ProtoBuffer() (*otsprotocol.GroupBy, error)

func (*GroupByRange) Range

func (g *GroupByRange) Range(fromInclusive float64, toExclusive float64) *GroupByRange

append a Range[from, to)

func (*GroupByRange) Serialize

func (g *GroupByRange) Serialize() ([]byte, error)

func (*GroupByRange) SubAggregation

func (g *GroupByRange) SubAggregation(subAggregation Aggregation) *GroupByRange

func (*GroupByRange) SubAggregations

func (g *GroupByRange) SubAggregations(subAggregations ...Aggregation) *GroupByRange

func (*GroupByRange) SubGroupBy

func (g *GroupByRange) SubGroupBy(subGroupBy GroupBy) *GroupByRange

func (*GroupByRange) SubGroupBys

func (g *GroupByRange) SubGroupBys(subGroupBys ...GroupBy) *GroupByRange

type GroupByRangeResult

type GroupByRangeResult struct {
	Name  string
	Items []GroupByRangeResultItem
}

func ParseGroupByRangeResultFromPB

func ParseGroupByRangeResultFromPB(pbGroupByResult *otsprotocol.GroupByResult) (*GroupByRangeResult, error)

func (*GroupByRangeResult) GetName

func (g *GroupByRangeResult) GetName() string

func (*GroupByRangeResult) GetType

func (g *GroupByRangeResult) GetType() GroupByType

type GroupByRangeResultItem

type GroupByRangeResultItem struct {
	RowCount int64
	From     float64
	To       float64

	SubAggregations AggregationResults
	SubGroupBys     GroupByResults
}

type GroupByResult

type GroupByResult interface {
	GetName() string
	GetType() GroupByType
}

type GroupByResults

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

func ParseGroupByResultsFromPB

func ParseGroupByResultsFromPB(pbGroupByResults []*otsprotocol.GroupByResult) (*GroupByResults, error)

func (GroupByResults) Empty

func (g GroupByResults) Empty() bool

func (*GroupByResults) GetRawResults

func (g *GroupByResults) GetRawResults() map[string]GroupByResult

func (GroupByResults) GroupByDateHistogram added in v1.7.10

func (g GroupByResults) GroupByDateHistogram(name string) (*GroupByDateHistogramResult, error)

func (GroupByResults) GroupByField

func (g GroupByResults) GroupByField(name string) (*GroupByFieldResult, error)

func (GroupByResults) GroupByFilter

func (g GroupByResults) GroupByFilter(name string) (*GroupByFilterResult, error)

func (GroupByResults) GroupByGeoDistance

func (g GroupByResults) GroupByGeoDistance(name string) (*GroupByGeoDistanceResult, error)

func (*GroupByResults) GroupByGeoGrid added in v1.7.12

func (g *GroupByResults) GroupByGeoGrid(name string) (*GroupByGeoGridResult, error)

func (GroupByResults) GroupByHistogram added in v1.7.0

func (g GroupByResults) GroupByHistogram(name string) (*GroupByHistogramResult, error)

func (GroupByResults) GroupByRange

func (g GroupByResults) GroupByRange(name string) (*GroupByRangeResult, error)

func (*GroupByResults) Put

func (g *GroupByResults) Put(name string, result GroupByResult)

type GroupBySort

type GroupBySort struct {
	Sorters []GroupBySorter
}

func (*GroupBySort) ProtoBuffer

func (s *GroupBySort) ProtoBuffer() (*otsprotocol.GroupBySort, error)

type GroupBySorter

type GroupBySorter interface {
	//should be implemented by each 'group by sorter'
	ProtoBuffer() (*otsprotocol.GroupBySorter, error)
}

interface of each child 'group by sorter'

type GroupByType

type GroupByType int
const (
	GroupByNoneType          GroupByType = 0
	GroupByFieldType         GroupByType = 1
	GroupByRangeType         GroupByType = 2
	GroupByFilterType        GroupByType = 3
	GroupByGeoDistanceType   GroupByType = 4
	GroupByHistogramType     GroupByType = 5
	GroupByDateHistogramType GroupByType = 6
	GroupByGeoGridType       GroupByType = 7
)

func (GroupByType) Enum

func (g GroupByType) Enum() *GroupByType

func (GroupByType) String

func (a GroupByType) String() string

func (GroupByType) ToPB

type GroupKeyGroupBySort

type GroupKeyGroupBySort struct {
	Order *SortOrder
}

func (*GroupKeyGroupBySort) ProtoBuffer

func (s *GroupKeyGroupBySort) ProtoBuffer() (*otsprotocol.GroupBySorter, error)

type Highlight added in v1.7.9

type Highlight struct {
	HighlightEncoder         *HighlightEncoder
	FieldHighlightParameters map[string]*HighlightParameter
}

func NewHighlight added in v1.7.9

func NewHighlight() *Highlight

func ToHighlight added in v1.7.9

func ToHighlight(pbHighlight *otsprotocol.Highlight) (*Highlight, error)

func (*Highlight) AddFieldHighlightParameter added in v1.7.9

func (highlight *Highlight) AddFieldHighlightParameter(fieldName string, param *HighlightParameter) *Highlight

func (*Highlight) ProtoBuffer added in v1.7.9

func (highlight *Highlight) ProtoBuffer() (*otsprotocol.Highlight, error)

func (*Highlight) SetFieldHighlightParameters added in v1.7.9

func (highlight *Highlight) SetFieldHighlightParameters(fieldHighlightParameters map[string]*HighlightParameter) *Highlight

func (*Highlight) SetHighlightEncoder added in v1.7.9

func (highlight *Highlight) SetHighlightEncoder(encoder HighlightEncoder) *Highlight

type HighlightEncoder added in v1.7.9

type HighlightEncoder int32
const (
	PlainMode HighlightEncoder = 1
	HtmlMode  HighlightEncoder = 2
)

func ToHighlightEncoder added in v1.7.9

func ToHighlightEncoder(encoderStr string) (HighlightEncoder, error)

func (HighlightEncoder) Enum added in v1.7.9

func (encoder HighlightEncoder) Enum() *HighlightEncoder

func (*HighlightEncoder) MarshalJSON added in v1.7.9

func (encoder *HighlightEncoder) MarshalJSON() (data []byte, err error)

func (*HighlightEncoder) ProtoBuffer added in v1.7.9

func (encoder *HighlightEncoder) ProtoBuffer() (*otsprotocol.HighlightEncoder, error)

func (HighlightEncoder) String added in v1.7.9

func (encoder HighlightEncoder) String() string

func (*HighlightEncoder) UnmarshalJSON added in v1.7.9

func (encoder *HighlightEncoder) UnmarshalJSON(data []byte) (err error)

type HighlightFragmentOrder added in v1.7.9

type HighlightFragmentOrder int32
const (
	TextSequence HighlightFragmentOrder = 1
	Score        HighlightFragmentOrder = 2
)

func ToHighlightFragmentOrder added in v1.7.9

func ToHighlightFragmentOrder(orderStr string) (HighlightFragmentOrder, error)

func (HighlightFragmentOrder) Enum added in v1.7.9

func (*HighlightFragmentOrder) MarshalJSON added in v1.7.9

func (order *HighlightFragmentOrder) MarshalJSON() (data []byte, err error)

func (*HighlightFragmentOrder) ProtoBuffer added in v1.7.9

func (HighlightFragmentOrder) String added in v1.7.9

func (order HighlightFragmentOrder) String() string

func (*HighlightFragmentOrder) UnmarshalJSON added in v1.7.9

func (order *HighlightFragmentOrder) UnmarshalJSON(data []byte) (err error)

type HighlightParameter added in v1.7.9

type HighlightParameter struct {
	NumberOfFragments      *int32
	FragmentSize           *int32
	PreTag                 *string
	PostTag                *string
	HighlightFragmentOrder *HighlightFragmentOrder
}

func NewHighlightParameter added in v1.7.9

func NewHighlightParameter() *HighlightParameter

func ToHighlightParameter added in v1.7.9

func ToHighlightParameter(pbParameter *otsprotocol.HighlightParameter) (param *HighlightParameter, err error)

func (*HighlightParameter) ProtoBuffer added in v1.7.9

func (param *HighlightParameter) ProtoBuffer() (*otsprotocol.HighlightParameter, error)

func (*HighlightParameter) SetFragmentSize added in v1.7.9

func (param *HighlightParameter) SetFragmentSize(fragmentSize int32) *HighlightParameter

func (*HighlightParameter) SetHighlightFragmentOrder added in v1.7.9

func (param *HighlightParameter) SetHighlightFragmentOrder(order HighlightFragmentOrder) *HighlightParameter

func (*HighlightParameter) SetNumberOfFragments added in v1.7.9

func (param *HighlightParameter) SetNumberOfFragments(numberOfFragments int32) *HighlightParameter

func (*HighlightParameter) SetPostTag added in v1.7.9

func (param *HighlightParameter) SetPostTag(postTag string) *HighlightParameter

func (*HighlightParameter) SetPreTag added in v1.7.9

func (param *HighlightParameter) SetPreTag(preTag string) *HighlightParameter

type InnerHits added in v1.7.12

type InnerHits struct {
	Offset    *int32
	Limit     *int32
	Sort      *Sort
	Highlight *Highlight
}

func (*InnerHits) ProtoBuffer added in v1.7.12

func (innerHits *InnerHits) ProtoBuffer() (pbInnerHits *otsprotocol.InnerHits, err error)

type KnnVectorQuery added in v1.7.13

type KnnVectorQuery struct {
	FieldName          string
	TopK               *int32
	Float32QueryVector []float32
	Int8QueryVector    []int8
	Filter             Query
}

func (*KnnVectorQuery) ProtoBuffer added in v1.7.13

func (q *KnnVectorQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*KnnVectorQuery) Serialize added in v1.7.13

func (q *KnnVectorQuery) Serialize() ([]byte, error)

func (*KnnVectorQuery) Type added in v1.7.13

func (q *KnnVectorQuery) Type() QueryType

type MatchAllQuery

type MatchAllQuery struct {
}

func (*MatchAllQuery) ProtoBuffer

func (q *MatchAllQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*MatchAllQuery) Serialize

func (q *MatchAllQuery) Serialize() ([]byte, error)

func (*MatchAllQuery) Type

func (q *MatchAllQuery) Type() QueryType

type MatchPhraseQuery

type MatchPhraseQuery struct {
	FieldName string
	Text      string
}

func (*MatchPhraseQuery) ProtoBuffer

func (q *MatchPhraseQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*MatchPhraseQuery) Serialize

func (q *MatchPhraseQuery) Serialize() ([]byte, error)

func (*MatchPhraseQuery) Type

func (q *MatchPhraseQuery) Type() QueryType

type MatchQuery

type MatchQuery struct {
	FieldName          string
	Text               string
	MinimumShouldMatch *int32
	Operator           *QueryOperator
}

func (*MatchQuery) ProtoBuffer

func (q *MatchQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*MatchQuery) Serialize

func (q *MatchQuery) Serialize() ([]byte, error)

func (*MatchQuery) Type

func (q *MatchQuery) Type() QueryType

type MathFunction added in v1.7.12

type MathFunction int32
const (
	GAUSS MathFunction = iota
	EXP
	LINEAR
)

func (MathFunction) Enum added in v1.7.12

func (m MathFunction) Enum() *MathFunction

func (*MathFunction) ProtoBuffer added in v1.7.12

func (f *MathFunction) ProtoBuffer() *otsprotocol.DecayMathFunction

type MaxAggregation

type MaxAggregation struct {
	AggName      string
	Field        string
	MissingValue interface{}
}

func NewMaxAggregation

func NewMaxAggregation(name string, fieldName string) *MaxAggregation

func (*MaxAggregation) FieldName

func (a *MaxAggregation) FieldName(fieldName string) *MaxAggregation

func (*MaxAggregation) GetName

func (a *MaxAggregation) GetName() string

func (*MaxAggregation) GetType

func (a *MaxAggregation) GetType() AggregationType

func (*MaxAggregation) Missing

func (a *MaxAggregation) Missing(missing interface{}) *MaxAggregation

func (*MaxAggregation) Name

func (a *MaxAggregation) Name(name string) *MaxAggregation

building chain

func (*MaxAggregation) ProtoBuffer

func (a *MaxAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)

func (*MaxAggregation) Serialize

func (a *MaxAggregation) Serialize() ([]byte, error)

type MaxAggregationResult

type MaxAggregationResult struct {
	Name  string
	Value float64 //-inf means missing value
}

func ParseMaxAggregationResultFromPB

func ParseMaxAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*MaxAggregationResult, error)

func (*MaxAggregationResult) GetName

func (a *MaxAggregationResult) GetName() string

func (*MaxAggregationResult) GetType

func (*MaxAggregationResult) HasValue

func (a *MaxAggregationResult) HasValue() bool

type MinAggregation

type MinAggregation struct {
	AggName      string
	Field        string
	MissingValue interface{}
}

func NewMinAggregation

func NewMinAggregation(name string, fieldName string) *MinAggregation

func (*MinAggregation) FieldName

func (a *MinAggregation) FieldName(fieldName string) *MinAggregation

func (*MinAggregation) GetName

func (a *MinAggregation) GetName() string

func (*MinAggregation) GetType

func (a *MinAggregation) GetType() AggregationType

func (*MinAggregation) Missing

func (a *MinAggregation) Missing(missing interface{}) *MinAggregation

func (*MinAggregation) Name

func (a *MinAggregation) Name(name string) *MinAggregation

building chain

func (*MinAggregation) ProtoBuffer

func (a *MinAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)

func (*MinAggregation) Serialize

func (a *MinAggregation) Serialize() ([]byte, error)

type MinAggregationResult

type MinAggregationResult struct {
	Name  string
	Value float64 //+inf means missing value
}

func ParseMinAggregationResultFromPB

func ParseMinAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*MinAggregationResult, error)

func (*MinAggregationResult) GetName

func (a *MinAggregationResult) GetName() string

func (*MinAggregationResult) GetType

func (*MinAggregationResult) HasValue

func (a *MinAggregationResult) HasValue() bool

type MultiValueMode added in v1.7.12

type MultiValueMode int32
const (
	MVM_MAX MultiValueMode = iota
	MVM_MIN
	MVM_SUM
	MVM_AVG
)

func (MultiValueMode) Enum added in v1.7.12

func (m MultiValueMode) Enum() *MultiValueMode

func (*MultiValueMode) ProtoBuffer added in v1.7.12

func (m *MultiValueMode) ProtoBuffer() *otsprotocol.MultiValueMode

type NestedFilter

type NestedFilter struct {
	Path   string
	Filter Query
}

func (*NestedFilter) ProtoBuffer

func (f *NestedFilter) ProtoBuffer() (*otsprotocol.NestedFilter, error)

type NestedQuery

type NestedQuery struct {
	Path      string
	Query     Query `json:"-"`
	ScoreMode ScoreModeType
	InnerHits *InnerHits

	// for json marshal and unmarshal
	QueryAlias queryAlias `json:"Query"`
}

func (*NestedQuery) MarshalJSON added in v1.7.3

func (q *NestedQuery) MarshalJSON() ([]byte, error)

func (*NestedQuery) ProtoBuffer

func (q *NestedQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*NestedQuery) Serialize

func (q *NestedQuery) Serialize() ([]byte, error)

func (*NestedQuery) Type

func (q *NestedQuery) Type() QueryType

func (*NestedQuery) UnmarshalJSON added in v1.7.3

func (q *NestedQuery) UnmarshalJSON(data []byte) (err error)

type ParamType added in v1.7.12

type ParamType int32
const (
	PT_DATE ParamType = iota
	PT_GEO
	PT_NUMERIC
)

func (ParamType) Enum added in v1.7.12

func (t ParamType) Enum() *ParamType

func (*ParamType) ProtoBuffer added in v1.7.12

func (t *ParamType) ProtoBuffer() *otsprotocol.DecayFuncParamType

type PercentilesAggregation added in v1.7.0

type PercentilesAggregation struct {
	AggName      string
	Field        string
	Percents     []float64
	MissingValue interface{}
}

func NewPercentilesAggregation added in v1.7.0

func NewPercentilesAggregation(name string, filedName string) *PercentilesAggregation

func (*PercentilesAggregation) GetName added in v1.7.0

func (a *PercentilesAggregation) GetName() string

func (*PercentilesAggregation) GetPercents added in v1.7.0

func (a *PercentilesAggregation) GetPercents() []float64

func (*PercentilesAggregation) GetType added in v1.7.0

func (*PercentilesAggregation) ProtoBuffer added in v1.7.0

func (a *PercentilesAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)

func (*PercentilesAggregation) Serialize added in v1.7.0

func (a *PercentilesAggregation) Serialize() ([]byte, error)

func (*PercentilesAggregation) SetFieldName added in v1.7.0

func (a *PercentilesAggregation) SetFieldName(fieldName string) *PercentilesAggregation

func (*PercentilesAggregation) SetMissing added in v1.7.0

func (a *PercentilesAggregation) SetMissing(missing interface{}) *PercentilesAggregation

func (*PercentilesAggregation) SetName added in v1.7.0

func (*PercentilesAggregation) SetPercents added in v1.7.0

func (a *PercentilesAggregation) SetPercents(percents []float64) *PercentilesAggregation

type PercentilesAggregationItem added in v1.7.0

type PercentilesAggregationItem struct {
	Key   float64
	Value model.ColumnValue
}

type PercentilesAggregationResult added in v1.7.0

type PercentilesAggregationResult struct {
	Name                        string
	PercentilesAggregationItems []PercentilesAggregationItem
}

func ParsePercentilesAggregationResultFromPB added in v1.7.0

func ParsePercentilesAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*PercentilesAggregationResult, error)

func (*PercentilesAggregationResult) GetName added in v1.7.0

func (a *PercentilesAggregationResult) GetName() string

func (*PercentilesAggregationResult) GetType added in v1.7.0

func (*PercentilesAggregationResult) HasValue added in v1.7.0

func (a *PercentilesAggregationResult) HasValue() bool

type PrefixQuery

type PrefixQuery struct {
	FieldName string
	Prefix    string
}

func (*PrefixQuery) ProtoBuffer

func (q *PrefixQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*PrefixQuery) Serialize

func (q *PrefixQuery) Serialize() ([]byte, error)

func (*PrefixQuery) Type

func (q *PrefixQuery) Type() QueryType

type PrimaryKeySort

type PrimaryKeySort struct {
	Order *SortOrder
}

func NewPrimaryKeySort

func NewPrimaryKeySort() *PrimaryKeySort

func (*PrimaryKeySort) ProtoBuffer

func (s *PrimaryKeySort) ProtoBuffer() (*otsprotocol.Sorter, error)

type Query

type Query interface {
	Type() QueryType
	Serialize() ([]byte, error)
	ProtoBuffer() (*otsprotocol.Query, error)
}

func UnmarshalQuery added in v1.7.3

func UnmarshalQuery(name string, data json.RawMessage) (Query, error)

type QueryOperator

type QueryOperator int8
const (
	QueryOperator_OR  QueryOperator = 0
	QueryOperator_AND QueryOperator = 1
)

func (QueryOperator) Enum

func (x QueryOperator) Enum() *QueryOperator

func (*QueryOperator) ProtoBuffer

func (o *QueryOperator) ProtoBuffer() (*otsprotocol.QueryOperator, error)

type QueryType

type QueryType int
const (
	QueryType_None                QueryType = 0
	QueryType_MatchQuery          QueryType = 1
	QueryType_MatchPhraseQuery    QueryType = 2
	QueryType_TermQuery           QueryType = 3
	QueryType_RangeQuery          QueryType = 4
	QueryType_PrefixQuery         QueryType = 5
	QueryType_BoolQuery           QueryType = 6
	QueryType_ConstScoreQuery     QueryType = 7
	QueryType_FunctionScoreQuery  QueryType = 8
	QueryType_NestedQuery         QueryType = 9
	QueryType_WildcardQuery       QueryType = 10
	QueryType_MatchAllQuery       QueryType = 11
	QueryType_GeoBoundingBoxQuery QueryType = 12
	QueryType_GeoDistanceQuery    QueryType = 13
	QueryType_GeoPolygonQuery     QueryType = 14
	QueryType_TermsQuery          QueryType = 15
	QueryType_ExistsQuery         QueryType = 16
	QueryType_KnnVectorQuery      QueryType = 17
	QueryType_FunctionsScoreQuery QueryType = 18
)

func ToQueryType added in v1.7.3

func ToQueryType(q string) QueryType

func (QueryType) Enum

func (q QueryType) Enum() *QueryType

func (QueryType) String added in v1.7.3

func (q QueryType) String() string

func (QueryType) ToPB

func (q QueryType) ToPB() *otsprotocol.QueryType

type RandomFunction added in v1.7.12

type RandomFunction struct {
}

func NewRandomFunction added in v1.7.12

func NewRandomFunction() *RandomFunction

func (*RandomFunction) ProtoBuffer added in v1.7.12

func (f *RandomFunction) ProtoBuffer() (*otsprotocol.RandomScoreFunction, error)

type Range

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

type RangeQuery

type RangeQuery struct {
	FieldName    string
	From         interface{}
	To           interface{}
	IncludeLower bool
	IncludeUpper bool
}

func (*RangeQuery) GT

func (q *RangeQuery) GT(value interface{})

func (*RangeQuery) GTE

func (q *RangeQuery) GTE(value interface{})

func (*RangeQuery) LT

func (q *RangeQuery) LT(value interface{})

func (*RangeQuery) LTE

func (q *RangeQuery) LTE(value interface{})

func (*RangeQuery) ProtoBuffer

func (q *RangeQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*RangeQuery) Serialize

func (q *RangeQuery) Serialize() ([]byte, error)

func (*RangeQuery) Type

func (q *RangeQuery) Type() QueryType

type RowCountGroupBySort

type RowCountGroupBySort struct {
	Order *SortOrder
}

func (*RowCountGroupBySort) ProtoBuffer

func (s *RowCountGroupBySort) ProtoBuffer() (*otsprotocol.GroupBySorter, error)

type ScanQuery added in v1.6.0

type ScanQuery interface {
	Serialize() ([]byte, error)
}

type ScoreFunction added in v1.7.12

type ScoreFunction struct {
	FieldValueFactorFunction *FieldValueFactorFunction
	DecayFunction            *DecayFunction
	RandomFunction           *RandomFunction
	Weight                   *float32
	Filter                   Query
}

func NewScoreFunction added in v1.7.12

func NewScoreFunction() *ScoreFunction

func (*ScoreFunction) ProtoBuffer added in v1.7.12

func (f *ScoreFunction) ProtoBuffer() (*otsprotocol.Function, error)

func (*ScoreFunction) SetDecayFunction added in v1.7.12

func (f *ScoreFunction) SetDecayFunction(function *DecayFunction) *ScoreFunction

func (*ScoreFunction) SetFieldValueFactorFunction added in v1.7.12

func (f *ScoreFunction) SetFieldValueFactorFunction(function *FieldValueFactorFunction) *ScoreFunction

func (*ScoreFunction) SetFilter added in v1.7.12

func (f *ScoreFunction) SetFilter(filter Query) *ScoreFunction

func (*ScoreFunction) SetRandomFunction added in v1.7.12

func (f *ScoreFunction) SetRandomFunction(function *RandomFunction) *ScoreFunction

func (*ScoreFunction) SetWeight added in v1.7.12

func (f *ScoreFunction) SetWeight(weight float32) *ScoreFunction

type ScoreMode added in v1.7.12

type ScoreMode int32
const (
	SM_AVG ScoreMode = iota
	SM_MAX
	SM_SUM
	SM_MIN
	SM_MULTIPLY
	SM_FIRST
)

func (ScoreMode) Enum added in v1.7.12

func (m ScoreMode) Enum() *ScoreMode

func (*ScoreMode) ProtoBuffer added in v1.7.12

func (m *ScoreMode) ProtoBuffer() *otsprotocol.FunctionScoreMode

type ScoreModeType

type ScoreModeType int
const (
	ScoreMode_None  ScoreModeType = 1
	ScoreMode_Avg   ScoreModeType = 2
	ScoreMode_Max   ScoreModeType = 3
	ScoreMode_Total ScoreModeType = 4
	ScoreMode_Min   ScoreModeType = 5
)

type ScoreSort

type ScoreSort struct {
	Order *SortOrder
}

func NewScoreSort

func NewScoreSort() *ScoreSort

func (*ScoreSort) ProtoBuffer

func (s *ScoreSort) ProtoBuffer() (*otsprotocol.Sorter, error)

type SearchQuery

type SearchQuery interface {
	Serialize() ([]byte, error)
}

type Sort

type Sort struct {
	Sorters []Sorter
}

func (*Sort) MarshalJSON added in v1.7.3

func (s *Sort) MarshalJSON() ([]byte, error)

func (*Sort) ProtoBuffer

func (s *Sort) ProtoBuffer() (*otsprotocol.Sort, error)

func (*Sort) UnmarshalJSON added in v1.7.3

func (r *Sort) UnmarshalJSON(data []byte) (err error)

type SortMode

type SortMode int8
const (
	SortMode_Min SortMode = 0
	SortMode_Max SortMode = 1
	SortMode_Avg SortMode = 2
)

func ToSortMode added in v1.7.3

func ToSortMode(mode string) (SortMode, error)

func (SortMode) Enum

func (x SortMode) Enum() *SortMode

func (*SortMode) MarshalJSON added in v1.7.3

func (op *SortMode) MarshalJSON() (data []byte, err error)

func (*SortMode) ProtoBuffer

func (m *SortMode) ProtoBuffer() (*otsprotocol.SortMode, error)

func (SortMode) String added in v1.7.3

func (mode SortMode) String() string

func (*SortMode) UnmarshalJSON added in v1.7.3

func (op *SortMode) UnmarshalJSON(data []byte) (err error)

type SortOrder

type SortOrder int8
const (
	SortOrder_ASC  SortOrder = 0
	SortOrder_DESC SortOrder = 1
)

func ParseSortOrder

func ParseSortOrder(order *otsprotocol.SortOrder) *SortOrder

func ToSortOrder added in v1.7.3

func ToSortOrder(order string) (SortOrder, error)

func (SortOrder) Enum

func (x SortOrder) Enum() *SortOrder

func (*SortOrder) MarshalJSON added in v1.7.3

func (op *SortOrder) MarshalJSON() (data []byte, err error)

func (*SortOrder) ProtoBuffer

func (o *SortOrder) ProtoBuffer() (*otsprotocol.SortOrder, error)

func (SortOrder) String added in v1.7.3

func (order SortOrder) String() string

func (*SortOrder) UnmarshalJSON added in v1.7.3

func (op *SortOrder) UnmarshalJSON(data []byte) (err error)

type Sorter

type Sorter interface {
	ProtoBuffer() (*otsprotocol.Sorter, error)
}

type SubAggGroupBySort

type SubAggGroupBySort struct {
	Order      *SortOrder
	SubAggName string
}

func (*SubAggGroupBySort) ProtoBuffer

func (s *SubAggGroupBySort) ProtoBuffer() (*otsprotocol.GroupBySorter, error)

type SumAggregation

type SumAggregation struct {
	AggName      string
	Field        string
	MissingValue interface{}
}

func NewSumAggregation

func NewSumAggregation(name string, fieldName string) *SumAggregation

func (*SumAggregation) FieldName

func (a *SumAggregation) FieldName(fieldName string) *SumAggregation

func (*SumAggregation) GetName

func (a *SumAggregation) GetName() string

func (*SumAggregation) GetType

func (a *SumAggregation) GetType() AggregationType

func (*SumAggregation) Missing

func (a *SumAggregation) Missing(missing interface{}) *SumAggregation

func (*SumAggregation) Name

func (a *SumAggregation) Name(name string) *SumAggregation

building chain

func (*SumAggregation) ProtoBuffer

func (a *SumAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)

func (*SumAggregation) Serialize

func (a *SumAggregation) Serialize() ([]byte, error)

type SumAggregationResult

type SumAggregationResult struct {
	Name  string
	Value float64 //0 means either field missing or 'sum is actually 0'
}

func ParseSumAggregationResultFromPB

func ParseSumAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*SumAggregationResult, error)

func (*SumAggregationResult) GetName

func (a *SumAggregationResult) GetName() string

func (*SumAggregationResult) GetType

type TermQuery

type TermQuery struct {
	FieldName string
	Term      interface{}
}

func (*TermQuery) ProtoBuffer

func (q *TermQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*TermQuery) Serialize

func (q *TermQuery) Serialize() ([]byte, error)

func (*TermQuery) Type

func (q *TermQuery) Type() QueryType

type TermsQuery

type TermsQuery struct {
	FieldName string
	Terms     []interface{}
}

func (*TermsQuery) ProtoBuffer

func (q *TermsQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*TermsQuery) Serialize

func (q *TermsQuery) Serialize() ([]byte, error)

func (*TermsQuery) Type

func (q *TermsQuery) Type() QueryType

type TopRowsAggregation added in v1.7.0

type TopRowsAggregation struct {
	AggName string
	Limit   *int32
	Sort    *Sort
}

func NewTopRowsAggregation added in v1.7.0

func NewTopRowsAggregation(name string) *TopRowsAggregation

func (*TopRowsAggregation) GetName added in v1.7.0

func (a *TopRowsAggregation) GetName() string

func (*TopRowsAggregation) GetType added in v1.7.0

func (a *TopRowsAggregation) GetType() AggregationType

func (*TopRowsAggregation) ProtoBuffer added in v1.7.0

func (a *TopRowsAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)

func (*TopRowsAggregation) Serialize added in v1.7.0

func (a *TopRowsAggregation) Serialize() ([]byte, error)

func (*TopRowsAggregation) SetLimit added in v1.7.0

func (a *TopRowsAggregation) SetLimit(limit int32) *TopRowsAggregation

func (*TopRowsAggregation) SetName added in v1.7.0

func (a *TopRowsAggregation) SetName(name string) *TopRowsAggregation

func (*TopRowsAggregation) SetSort added in v1.7.0

func (a *TopRowsAggregation) SetSort(sort *Sort) *TopRowsAggregation

type TopRowsAggregationResult added in v1.7.0

type TopRowsAggregationResult struct {
	Name  string
	Value []model.Row
}

func ParseTopRowsAggregationResultFromPB added in v1.7.0

func ParseTopRowsAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*TopRowsAggregationResult, error)

func (*TopRowsAggregationResult) GetName added in v1.7.0

func (a *TopRowsAggregationResult) GetName() string

func (*TopRowsAggregationResult) GetType added in v1.7.0

func (*TopRowsAggregationResult) HasValue added in v1.7.0

func (a *TopRowsAggregationResult) HasValue() bool

type VariantType

type VariantType byte
const (
	// variant type
	VT_INTEGER VariantType = 0x0
	VT_DOUBLE  VariantType = 0x1
	VT_BOOLEAN VariantType = 0x2
	VT_STRING  VariantType = 0x3
)

type VariantValue

type VariantValue []byte

func ToVariantValue

func ToVariantValue(value interface{}) (VariantValue, error)

func VTBoolean

func VTBoolean(b bool) VariantValue

func VTDouble

func VTDouble(v float64) VariantValue

func VTInteger

func VTInteger(v int64) VariantValue

func VTString

func VTString(v string) VariantValue

func (*VariantValue) GetType

func (v *VariantValue) GetType() VariantType

type WildcardQuery

type WildcardQuery struct {
	FieldName string
	Value     string
}

func (*WildcardQuery) ProtoBuffer

func (q *WildcardQuery) ProtoBuffer() (*otsprotocol.Query, error)

func (*WildcardQuery) Serialize

func (q *WildcardQuery) Serialize() ([]byte, error)

func (*WildcardQuery) Type

func (q *WildcardQuery) Type() QueryType

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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