Documentation ¶
Index ¶
- Variables
- 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 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) Put(name string, result AggregationResult)
- func (a AggregationResults) Sum(name string) (*SumAggregationResult, 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
- type GeoBoundingBoxQuery
- type GeoDistanceQuery
- type GeoDistanceSort
- type GeoDistanceType
- type GeoPoint
- type GeoPolygonQuery
- type GroupBy
- 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 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) GroupByField(name string) (*GroupByFieldResult, error)
- func (g GroupByResults) GroupByFilter(name string) (*GroupByFilterResult, error)
- func (g GroupByResults) GroupByGeoDistance(name string) (*GroupByGeoDistanceResult, 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 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 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 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 VariantType
- type VariantValue
- type WildcardQuery
Constants ¶
This section is empty.
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 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; }
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) Put ¶
func (a *AggregationResults) Put(name string, result AggregationResult)
func (AggregationResults) Sum ¶
func (a AggregationResults) Sum(name string) (*SumAggregationResult, 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 )
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 MustNotQueries []Query FilterQueries []Query ShouldQueries []Query MinimumShouldMatch *int32 }
func (*BoolQuery) ProtoBuffer ¶
func (q *BoolQuery) ProtoBuffer() (*otsprotocol.Query, error)
type Collapse ¶
type Collapse struct {
FieldName string
}
func (*Collapse) ProtoBuffer ¶
func (c *Collapse) ProtoBuffer() (*otsprotocol.Collapse, error)
type ConstScoreQuery ¶
type ConstScoreQuery struct {
Filter Query
}
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
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 }
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 FieldValueFactor *FieldValueFactor }
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
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 = 0 )
func (*GeoDistanceType) ProtoBuffer ¶
func (t *GeoDistanceType) ProtoBuffer() (*otsprotocol.GeoDistanceType, 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 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 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) 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) 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 )
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 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 ScoreMode ScoreModeType }
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
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 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 (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) ProtoBuffer ¶
func (s *Sort) ProtoBuffer() (*otsprotocol.Sort, error)
type SortMode ¶
type SortMode int8
func (*SortMode) ProtoBuffer ¶
func (m *SortMode) ProtoBuffer() (*otsprotocol.SortMode, error)
type SortOrder ¶
type SortOrder int8
func ParseSortOrder ¶
func ParseSortOrder(order *otsprotocol.SortOrder) *SortOrder
func (*SortOrder) ProtoBuffer ¶
func (o *SortOrder) ProtoBuffer() (*otsprotocol.SortOrder, error)
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 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_results.go
- aggregation_sum.go
- aggregation_sum_result.go
- collapse.go
- geo_point.go
- group_by.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_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
- 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
- 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.