Documentation ¶
Index ¶
- Constants
- Variables
- func AsBoolean(bytes []byte) (bool, error)
- func AsDouble(bytes []byte) (float64, error)
- func AsInteger(bytes []byte) (int64, error)
- func AsString(bytes []byte) (string, error)
- func BuildPBForAggregation(a Aggregation) (*otsprotocol.Aggregation, error)
- func BuildPBForAggregations(aggs []Aggregation) (*otsprotocol.Aggregations, error)
- func BuildPBForGroupBy(g GroupBy) (*otsprotocol.GroupBy, error)
- func BuildPBForGroupBys(groupBys []GroupBy) (*otsprotocol.GroupBys, error)
- func BuildPBForQuery(q Query) (*otsprotocol.Query, error)
- func BuildPBForRanges(ranges []Range) ([]*otsprotocol.Range, error)
- func ForceConvertToDestColumnValue(bytes []byte) (*model.ColumnValue, error)
- func NewScanQuery() *scanQuery
- func NewSearchQuery() *searchQuery
- type Aggregation
- type AggregationResult
- type AggregationResults
- func (a AggregationResults) Avg(name string) (*AvgAggregationResult, error)
- func (a AggregationResults) Count(name string) (*CountAggregationResult, error)
- func (a AggregationResults) DistinctCount(name string) (*DistinctCountAggregationResult, error)
- func (a AggregationResults) Empty() bool
- func (a *AggregationResults) GetRawResults() map[string]AggregationResult
- func (a AggregationResults) Max(name string) (*MaxAggregationResult, error)
- func (a AggregationResults) Min(name string) (*MinAggregationResult, error)
- func (a AggregationResults) Percentiles(name string) (*PercentilesAggregationResult, error)
- func (a *AggregationResults) Put(name string, result AggregationResult)
- func (a AggregationResults) Sum(name string) (*SumAggregationResult, error)
- func (a AggregationResults) TopRows(name string) (*TopRowsAggregationResult, error)
- type AggregationType
- type AvgAggregation
- func (a *AvgAggregation) FieldName(fieldName string) *AvgAggregation
- func (a *AvgAggregation) GetName() string
- func (a *AvgAggregation) GetType() AggregationType
- func (a *AvgAggregation) Missing(missing interface{}) *AvgAggregation
- func (a *AvgAggregation) Name(name string) *AvgAggregation
- func (a *AvgAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *AvgAggregation) Serialize() ([]byte, error)
- type AvgAggregationResult
- type BoolQuery
- type Collapse
- type ConstScoreQuery
- type CountAggregation
- func (a *CountAggregation) FieldName(fieldName string) *CountAggregation
- func (a *CountAggregation) GetName() string
- func (a *CountAggregation) GetType() AggregationType
- func (a *CountAggregation) Name(name string) *CountAggregation
- func (a *CountAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *CountAggregation) Serialize() ([]byte, error)
- type CountAggregationResult
- type DistinctCountAggregation
- func (a *DistinctCountAggregation) FieldName(fieldName string) *DistinctCountAggregation
- func (a *DistinctCountAggregation) GetName() string
- func (a *DistinctCountAggregation) GetType() AggregationType
- func (a *DistinctCountAggregation) Missing(missing interface{}) *DistinctCountAggregation
- func (a *DistinctCountAggregation) Name(name string) *DistinctCountAggregation
- func (a *DistinctCountAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *DistinctCountAggregation) Serialize() ([]byte, error)
- type DistinctCountAggregationResult
- type ExistsQuery
- type FieldSort
- type FieldValueFactor
- type FunctionScoreQuery
- func (q *FunctionScoreQuery) MarshalJSON() ([]byte, error)
- func (q *FunctionScoreQuery) ProtoBuffer() (*otsprotocol.Query, error)
- func (q *FunctionScoreQuery) Serialize() ([]byte, error)
- func (q *FunctionScoreQuery) Type() QueryType
- func (q *FunctionScoreQuery) UnmarshalJSON(data []byte) (err error)
- type GeoBoundingBoxQuery
- type GeoDistanceQuery
- type GeoDistanceSort
- type GeoDistanceType
- type GeoPoint
- type GeoPolygonQuery
- type GroupBy
- type GroupByDateHistogram
- func (g *GroupByDateHistogram) GetField() string
- func (g *GroupByDateHistogram) GetInterval() model.DateTimeValue
- func (g *GroupByDateHistogram) GetMinDocCount() *int64
- func (g *GroupByDateHistogram) GetName() string
- func (g *GroupByDateHistogram) GetTimeZone() *string
- func (g *GroupByDateHistogram) GetType() GroupByType
- func (g *GroupByDateHistogram) ProtoBuffer() (*otsprotocol.GroupBy, error)
- func (g *GroupByDateHistogram) Serialize() ([]byte, error)
- func (g *GroupByDateHistogram) SetFieldName(fieldName string) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SetFiledRange(min interface{}, max interface{}) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SetGroupBySorters(sorters []GroupBySorter) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SetInterval(interval model.DateTimeValue) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SetMinDocCount(minDocCount int64) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SetMissing(missing interface{}) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SetName(name string) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SetTimeZone(timeZone string) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SubAggregation(subAggregation Aggregation) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SubAggregations(subAggregations ...Aggregation) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SubGroupBy(subGroupBy GroupBy) *GroupByDateHistogram
- func (g *GroupByDateHistogram) SubGroupBys(subGroupBys ...GroupBy) *GroupByDateHistogram
- type GroupByDateHistogramItem
- type GroupByDateHistogramResult
- type GroupByField
- func (g *GroupByField) FieldName(fieldName string) *GroupByField
- func (g *GroupByField) GetName() string
- func (g *GroupByField) GetType() GroupByType
- func (g *GroupByField) GroupBySorters(sorters []GroupBySorter) *GroupByField
- func (g *GroupByField) Name(name string) *GroupByField
- func (g *GroupByField) ProtoBuffer() (*otsprotocol.GroupBy, error)
- func (g *GroupByField) Serialize() ([]byte, error)
- func (g *GroupByField) Size(size int32) *GroupByField
- func (g *GroupByField) SubAggregation(subAggregation Aggregation) *GroupByField
- func (g *GroupByField) SubAggregations(subAggregations ...Aggregation) *GroupByField
- func (g *GroupByField) SubGroupBy(subGroupBy GroupBy) *GroupByField
- func (g *GroupByField) SubGroupBys(subGroupBys ...GroupBy) *GroupByField
- type GroupByFieldResult
- type GroupByFieldResultItem
- type GroupByFilter
- func (g *GroupByFilter) GetName() string
- func (g *GroupByFilter) GetType() GroupByType
- func (g *GroupByFilter) Name(name string) *GroupByFilter
- func (g *GroupByFilter) ProtoBuffer() (*otsprotocol.GroupBy, error)
- func (g *GroupByFilter) Query(query Query) *GroupByFilter
- func (g *GroupByFilter) Serialize() ([]byte, error)
- func (g *GroupByFilter) SubAggregation(subAggregation Aggregation) *GroupByFilter
- func (g *GroupByFilter) SubAggregations(subAggregations ...Aggregation) *GroupByFilter
- func (g *GroupByFilter) SubGroupBy(subGroupBy GroupBy) *GroupByFilter
- func (g *GroupByFilter) SubGroupBys(subGroupBys ...GroupBy) *GroupByFilter
- type GroupByFilterResult
- type GroupByFilterResultItem
- type GroupByGeoDistance
- func (g *GroupByGeoDistance) CenterPoint(latitude float64, longitude float64) *GroupByGeoDistance
- func (g *GroupByGeoDistance) FieldName(fieldName string) *GroupByGeoDistance
- func (g *GroupByGeoDistance) GetName() string
- func (g *GroupByGeoDistance) GetType() GroupByType
- func (g *GroupByGeoDistance) Name(name string) *GroupByGeoDistance
- func (g *GroupByGeoDistance) ProtoBuffer() (*otsprotocol.GroupBy, error)
- func (g *GroupByGeoDistance) Range(fromInclusive float64, toExclusive float64) *GroupByGeoDistance
- func (g *GroupByGeoDistance) Serialize() ([]byte, error)
- func (g *GroupByGeoDistance) SubAggregation(subAggregation Aggregation) *GroupByGeoDistance
- func (g *GroupByGeoDistance) SubAggregations(subAggregations ...Aggregation) *GroupByGeoDistance
- func (g *GroupByGeoDistance) SubGroupBy(subGroupBy GroupBy) *GroupByGeoDistance
- func (g *GroupByGeoDistance) SubGroupBys(subGroupBys ...GroupBy) *GroupByGeoDistance
- type GroupByGeoDistanceResult
- type GroupByGeoDistanceResultItem
- type GroupByHistogram
- func (g *GroupByHistogram) GetField() string
- func (g *GroupByHistogram) GetName() string
- func (g *GroupByHistogram) GetType() GroupByType
- func (g *GroupByHistogram) ProtoBuffer() (*otsprotocol.GroupBy, error)
- func (g *GroupByHistogram) Serialize() ([]byte, error)
- func (g *GroupByHistogram) SetFieldName(fieldName string) *GroupByHistogram
- func (g *GroupByHistogram) SetFiledRange(min interface{}, max interface{}) *GroupByHistogram
- func (g *GroupByHistogram) SetGroupBySorters(sorters []GroupBySorter) *GroupByHistogram
- func (g *GroupByHistogram) SetInterval(interval interface{}) *GroupByHistogram
- func (g *GroupByHistogram) SetMinDocCount(minDocCount int64) *GroupByHistogram
- func (g *GroupByHistogram) SetMissing(missing interface{}) *GroupByHistogram
- func (g *GroupByHistogram) SetName(name string) *GroupByHistogram
- func (g *GroupByHistogram) SubAggregation(subAggregation Aggregation) *GroupByHistogram
- func (g *GroupByHistogram) SubAggregations(subAggregations ...Aggregation) *GroupByHistogram
- func (g *GroupByHistogram) SubGroupBy(subGroupBy GroupBy) *GroupByHistogram
- func (g *GroupByHistogram) SubGroupBys(subGroupBys ...GroupBy) *GroupByHistogram
- type GroupByHistogramItem
- type GroupByHistogramResult
- type GroupByRange
- func (g *GroupByRange) FieldName(fieldName string) *GroupByRange
- func (g *GroupByRange) GetName() string
- func (g *GroupByRange) GetType() GroupByType
- func (g *GroupByRange) Name(name string) *GroupByRange
- func (g *GroupByRange) ProtoBuffer() (*otsprotocol.GroupBy, error)
- func (g *GroupByRange) Range(fromInclusive float64, toExclusive float64) *GroupByRange
- func (g *GroupByRange) Serialize() ([]byte, error)
- func (g *GroupByRange) SubAggregation(subAggregation Aggregation) *GroupByRange
- func (g *GroupByRange) SubAggregations(subAggregations ...Aggregation) *GroupByRange
- func (g *GroupByRange) SubGroupBy(subGroupBy GroupBy) *GroupByRange
- func (g *GroupByRange) SubGroupBys(subGroupBys ...GroupBy) *GroupByRange
- type GroupByRangeResult
- type GroupByRangeResultItem
- type GroupByResult
- type GroupByResults
- func (g GroupByResults) Empty() bool
- func (g *GroupByResults) GetRawResults() map[string]GroupByResult
- func (g GroupByResults) GroupByDateHistogram(name string) (*GroupByDateHistogramResult, error)
- func (g GroupByResults) GroupByField(name string) (*GroupByFieldResult, error)
- func (g GroupByResults) GroupByFilter(name string) (*GroupByFilterResult, error)
- func (g GroupByResults) GroupByGeoDistance(name string) (*GroupByGeoDistanceResult, error)
- func (g GroupByResults) GroupByHistogram(name string) (*GroupByHistogramResult, error)
- func (g GroupByResults) GroupByRange(name string) (*GroupByRangeResult, error)
- func (g *GroupByResults) Put(name string, result GroupByResult)
- type GroupBySort
- type GroupBySorter
- type GroupByType
- type GroupKeyGroupBySort
- type Highlight
- func (highlight *Highlight) AddFieldHighlightParameter(fieldName string, param *HighlightParameter) *Highlight
- func (highlight *Highlight) ProtoBuffer() (*otsprotocol.Highlight, error)
- func (highlight *Highlight) SetFieldHighlightParameters(fieldHighlightParameters map[string]*HighlightParameter) *Highlight
- func (highlight *Highlight) SetHighlightEncoder(encoder HighlightEncoder) *Highlight
- type HighlightEncoder
- func (encoder HighlightEncoder) Enum() *HighlightEncoder
- func (encoder *HighlightEncoder) MarshalJSON() (data []byte, err error)
- func (encoder *HighlightEncoder) ProtoBuffer() (*otsprotocol.HighlightEncoder, error)
- func (encoder HighlightEncoder) String() string
- func (encoder *HighlightEncoder) UnmarshalJSON(data []byte) (err error)
- type HighlightFragmentOrder
- func (order HighlightFragmentOrder) Enum() *HighlightFragmentOrder
- func (order *HighlightFragmentOrder) MarshalJSON() (data []byte, err error)
- func (order *HighlightFragmentOrder) ProtoBuffer() (*otsprotocol.HighlightFragmentOrder, error)
- func (order HighlightFragmentOrder) String() string
- func (order *HighlightFragmentOrder) UnmarshalJSON(data []byte) (err error)
- type HighlightParameter
- func (param *HighlightParameter) ProtoBuffer() (*otsprotocol.HighlightParameter, error)
- func (param *HighlightParameter) SetFragmentSize(fragmentSize int32) *HighlightParameter
- func (param *HighlightParameter) SetHighlightFragmentOrder(order HighlightFragmentOrder) *HighlightParameter
- func (param *HighlightParameter) SetNumberOfFragments(numberOfFragments int32) *HighlightParameter
- func (param *HighlightParameter) SetPostTag(postTag string) *HighlightParameter
- func (param *HighlightParameter) SetPreTag(preTag string) *HighlightParameter
- type MatchAllQuery
- type MatchPhraseQuery
- type MatchQuery
- type MaxAggregation
- func (a *MaxAggregation) FieldName(fieldName string) *MaxAggregation
- func (a *MaxAggregation) GetName() string
- func (a *MaxAggregation) GetType() AggregationType
- func (a *MaxAggregation) Missing(missing interface{}) *MaxAggregation
- func (a *MaxAggregation) Name(name string) *MaxAggregation
- func (a *MaxAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *MaxAggregation) Serialize() ([]byte, error)
- type MaxAggregationResult
- type MinAggregation
- func (a *MinAggregation) FieldName(fieldName string) *MinAggregation
- func (a *MinAggregation) GetName() string
- func (a *MinAggregation) GetType() AggregationType
- func (a *MinAggregation) Missing(missing interface{}) *MinAggregation
- func (a *MinAggregation) Name(name string) *MinAggregation
- func (a *MinAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *MinAggregation) Serialize() ([]byte, error)
- type MinAggregationResult
- type NestedFilter
- type NestedQuery
- type PercentilesAggregation
- func (a *PercentilesAggregation) GetName() string
- func (a *PercentilesAggregation) GetPercents() []float64
- func (a *PercentilesAggregation) GetType() AggregationType
- func (a *PercentilesAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *PercentilesAggregation) Serialize() ([]byte, error)
- func (a *PercentilesAggregation) SetFieldName(fieldName string) *PercentilesAggregation
- func (a *PercentilesAggregation) SetMissing(missing interface{}) *PercentilesAggregation
- func (a *PercentilesAggregation) SetName(name string) *PercentilesAggregation
- func (a *PercentilesAggregation) SetPercents(percents []float64) *PercentilesAggregation
- type PercentilesAggregationItem
- type PercentilesAggregationResult
- type PrefixQuery
- type PrimaryKeySort
- type Query
- type QueryOperator
- type QueryType
- type Range
- type RangeQuery
- func (q *RangeQuery) GT(value interface{})
- func (q *RangeQuery) GTE(value interface{})
- func (q *RangeQuery) LT(value interface{})
- func (q *RangeQuery) LTE(value interface{})
- func (q *RangeQuery) ProtoBuffer() (*otsprotocol.Query, error)
- func (q *RangeQuery) Serialize() ([]byte, error)
- func (q *RangeQuery) Type() QueryType
- type RowCountGroupBySort
- type ScanQuery
- type ScoreModeType
- type ScoreSort
- type SearchQuery
- type Sort
- type SortMode
- type SortOrder
- type Sorter
- type SubAggGroupBySort
- type SumAggregation
- func (a *SumAggregation) FieldName(fieldName string) *SumAggregation
- func (a *SumAggregation) GetName() string
- func (a *SumAggregation) GetType() AggregationType
- func (a *SumAggregation) Missing(missing interface{}) *SumAggregation
- func (a *SumAggregation) Name(name string) *SumAggregation
- func (a *SumAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *SumAggregation) Serialize() ([]byte, error)
- type SumAggregationResult
- type TermQuery
- type TermsQuery
- type TopRowsAggregation
- func (a *TopRowsAggregation) GetName() string
- func (a *TopRowsAggregation) GetType() AggregationType
- func (a *TopRowsAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
- func (a *TopRowsAggregation) Serialize() ([]byte, error)
- func (a *TopRowsAggregation) SetLimit(limit int32) *TopRowsAggregation
- func (a *TopRowsAggregation) SetName(name string) *TopRowsAggregation
- func (a *TopRowsAggregation) SetSort(sort *Sort) *TopRowsAggregation
- type TopRowsAggregationResult
- type VariantType
- type VariantValue
- type WildcardQuery
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 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 (a AggregationResults) Avg(name string) (*AvgAggregationResult, error)
func (AggregationResults) Count ¶
func (a AggregationResults) Count(name string) (*CountAggregationResult, error)
func (AggregationResults) DistinctCount ¶
func (a AggregationResults) DistinctCount(name string) (*DistinctCountAggregationResult, error)
func (AggregationResults) Empty ¶
func (a AggregationResults) Empty() bool
func (*AggregationResults) GetRawResults ¶
func (a *AggregationResults) GetRawResults() map[string]AggregationResult
func (AggregationResults) Max ¶
func (a AggregationResults) Max(name string) (*MaxAggregationResult, error)
func (AggregationResults) Min ¶
func (a AggregationResults) Min(name string) (*MinAggregationResult, error)
func (AggregationResults) Percentiles ¶ added in v1.7.0
func (a AggregationResults) Percentiles(name string) (*PercentilesAggregationResult, error)
func (*AggregationResults) Put ¶
func (a *AggregationResults) Put(name string, result AggregationResult)
func (AggregationResults) Sum ¶
func (a AggregationResults) Sum(name string) (*SumAggregationResult, error)
func (AggregationResults) TopRows ¶ added in v1.7.0
func (a AggregationResults) TopRows(name string) (*TopRowsAggregationResult, error)
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 ¶
func (a AggregationType) ToPB() *otsprotocol.AggregationType
type AvgAggregation ¶
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 ¶
func ParseAvgAggregationResultFromPB ¶
func ParseAvgAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*AvgAggregationResult, error)
func (*AvgAggregationResult) GetName ¶
func (a *AvgAggregationResult) GetName() string
func (*AvgAggregationResult) GetType ¶
func (a *AvgAggregationResult) GetType() AggregationType
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 (*BoolQuery) ProtoBuffer ¶
func (q *BoolQuery) ProtoBuffer() (*otsprotocol.Query, error)
func (*BoolQuery) UnmarshalJSON ¶ added in v1.7.3
type Collapse ¶
type Collapse struct {
FieldName string
}
func (*Collapse) ProtoBuffer ¶
func (c *Collapse) ProtoBuffer() (*otsprotocol.Collapse, error)
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 ¶
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 ¶
func ParseCountAggregationResultFromPB ¶
func ParseCountAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*CountAggregationResult, error)
func (*CountAggregationResult) GetName ¶
func (a *CountAggregationResult) GetName() string
func (*CountAggregationResult) GetType ¶
func (a *CountAggregationResult) GetType() AggregationType
type DistinctCountAggregation ¶
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 (a *DistinctCountAggregation) GetType() AggregationType
func (*DistinctCountAggregation) Missing ¶
func (a *DistinctCountAggregation) Missing(missing interface{}) *DistinctCountAggregation
func (*DistinctCountAggregation) Name ¶
func (a *DistinctCountAggregation) Name(name string) *DistinctCountAggregation
building chain
func (*DistinctCountAggregation) ProtoBuffer ¶
func (a *DistinctCountAggregation) ProtoBuffer() (*otsprotocol.Aggregation, error)
func (*DistinctCountAggregation) Serialize ¶
func (a *DistinctCountAggregation) Serialize() ([]byte, error)
type DistinctCountAggregationResult ¶
func ParseDistinctCountAggregationResultFromPB ¶
func ParseDistinctCountAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*DistinctCountAggregationResult, error)
func (*DistinctCountAggregationResult) GetName ¶
func (a *DistinctCountAggregationResult) GetName() string
func (*DistinctCountAggregationResult) GetType ¶
func (a *DistinctCountAggregationResult) GetType() AggregationType
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 (*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 FunctionScoreQuery ¶
type FunctionScoreQuery struct { Query Query `json:"-"` FieldValueFactor *FieldValueFactor // for json marshal and unmarshal QueryAlias queryAlias `json:"Query"` }
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 GeoBoundingBoxQuery ¶
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 ¶
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 GeoPolygonQuery ¶
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 (g *GroupByDateHistogram) SetInterval(interval model.DateTimeValue) *GroupByDateHistogram
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 (g *GroupByDateHistogram) SetName(name string) *GroupByDateHistogram
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
func (g *GroupByDateHistogramResult) GetType() GroupByType
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 (g *GroupByGeoDistance) Name(name string) *GroupByGeoDistance
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 ¶
func (g *GroupByGeoDistanceResult) GetType() GroupByType
type GroupByGeoDistanceResultItem ¶
type GroupByGeoDistanceResultItem struct { RowCount int64 From float64 To float64 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) 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 )
func (GroupByType) Enum ¶
func (g GroupByType) Enum() *GroupByType
func (GroupByType) String ¶
func (a GroupByType) String() string
func (GroupByType) ToPB ¶
func (g GroupByType) ToPB() *otsprotocol.GroupByType
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 (order HighlightFragmentOrder) Enum() *HighlightFragmentOrder
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 (order *HighlightFragmentOrder) ProtoBuffer() (*otsprotocol.HighlightFragmentOrder, error)
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 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 ¶
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 MaxAggregation ¶
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 ¶
func ParseMaxAggregationResultFromPB ¶
func ParseMaxAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*MaxAggregationResult, error)
func (*MaxAggregationResult) GetName ¶
func (a *MaxAggregationResult) GetName() string
func (*MaxAggregationResult) GetType ¶
func (a *MaxAggregationResult) GetType() AggregationType
func (*MaxAggregationResult) HasValue ¶
func (a *MaxAggregationResult) HasValue() bool
type MinAggregation ¶
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 ¶
func ParseMinAggregationResultFromPB ¶
func ParseMinAggregationResultFromPB(pbAggResult *otsprotocol.AggregationResult) (*MinAggregationResult, error)
func (*MinAggregationResult) GetName ¶
func (a *MinAggregationResult) GetName() string
func (*MinAggregationResult) GetType ¶
func (a *MinAggregationResult) GetType() AggregationType
func (*MinAggregationResult) HasValue ¶
func (a *MinAggregationResult) HasValue() bool
type NestedFilter ¶
func (*NestedFilter) ProtoBuffer ¶
func (f *NestedFilter) ProtoBuffer() (*otsprotocol.NestedFilter, error)
type NestedQuery ¶
type NestedQuery struct { Path string Query Query `json:"-"` ScoreMode ScoreModeType // 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 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 (a *PercentilesAggregation) GetType() AggregationType
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 (a *PercentilesAggregation) SetName(name string) *PercentilesAggregation
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 (a *PercentilesAggregationResult) GetType() AggregationType
func (*PercentilesAggregationResult) HasValue ¶ added in v1.7.0
func (a *PercentilesAggregationResult) HasValue() bool
type PrefixQuery ¶
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 )
func ToQueryType ¶ added in v1.7.3
func (QueryType) ToPB ¶
func (q QueryType) ToPB() *otsprotocol.QueryType
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 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 Sort ¶
type Sort struct {
Sorters []Sorter
}
func (*Sort) MarshalJSON ¶ added in v1.7.3
func (*Sort) ProtoBuffer ¶
func (s *Sort) ProtoBuffer() (*otsprotocol.Sort, error)
func (*Sort) UnmarshalJSON ¶ added in v1.7.3
type SortMode ¶
type SortMode int8
func ToSortMode ¶ added in v1.7.3
func (*SortMode) MarshalJSON ¶ added in v1.7.3
func (*SortMode) ProtoBuffer ¶
func (m *SortMode) ProtoBuffer() (*otsprotocol.SortMode, error)
func (*SortMode) UnmarshalJSON ¶ added in v1.7.3
type SortOrder ¶
type SortOrder int8
func ParseSortOrder ¶
func ParseSortOrder(order *otsprotocol.SortOrder) *SortOrder
func ToSortOrder ¶ added in v1.7.3
func (*SortOrder) MarshalJSON ¶ added in v1.7.3
func (*SortOrder) ProtoBuffer ¶
func (o *SortOrder) ProtoBuffer() (*otsprotocol.SortOrder, error)
func (*SortOrder) UnmarshalJSON ¶ added in v1.7.3
type Sorter ¶
type Sorter interface {
ProtoBuffer() (*otsprotocol.Sorter, error)
}
type SubAggGroupBySort ¶
func (*SubAggGroupBySort) ProtoBuffer ¶
func (s *SubAggGroupBySort) ProtoBuffer() (*otsprotocol.GroupBySorter, error)
type SumAggregation ¶
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 ¶
func (a *SumAggregationResult) GetType() AggregationType
type TermQuery ¶
type TermQuery struct { FieldName string Term interface{} }
func (*TermQuery) ProtoBuffer ¶
func (q *TermQuery) ProtoBuffer() (*otsprotocol.Query, error)
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
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
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 (a *TopRowsAggregationResult) GetType() AggregationType
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 ¶
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 ¶
- aggregation.go
- aggregation_avg.go
- aggregation_avg_result.go
- aggregation_count.go
- aggregation_count_result.go
- aggregation_distinct_count.go
- aggregation_distinct_count_result.go
- aggregation_max.go
- aggregation_max_result.go
- aggregation_min.go
- aggregation_min_result.go
- aggregation_percentiles.go
- aggregation_percentiles_result.go
- aggregation_results.go
- aggregation_sum.go
- aggregation_sum_result.go
- aggregation_top_rows.go
- aggregation_top_rows_result.go
- collapse.go
- geo_point.go
- group_by.go
- group_by_date_histogram.go
- group_by_date_histogram_result.go
- group_by_field.go
- group_by_field_result.go
- group_by_filter.go
- group_by_filter_result.go
- group_by_geo_distance.go
- group_by_geo_distance_result.go
- group_by_histogram.go
- group_by_histogram_result.go
- group_by_range.go
- group_by_range_result.go
- group_by_results.go
- group_by_sort.go
- group_by_sort_group_key.go
- group_by_sort_row_count.go
- group_by_sort_sub_agg.go
- highlight.go
- query.go
- query_bool.go
- query_const_score.go
- query_exists.go
- query_function_score.go
- query_geo_bounding_box.go
- query_geo_distance.go
- query_geo_polygon.go
- query_match.go
- query_match_phrase.go
- query_matchall.go
- query_nested.go
- query_prefix.go
- query_range.go
- query_term.go
- query_terms.go
- query_wildcard.go
- range.go
- scan_query.go
- search_query.go
- sort.go
- sort_field.go
- sort_geo_distance.go
- sort_mode.go
- sort_order.go
- sort_primary_key.go
- sort_score.go
- variant_types.go
Click to show internal directories.
Click to hide internal directories.