Documentation ¶
Index ¶
- func BuildPBForQuery(q Query) (*otsprotocol.Query, error)
- func NewSearchQuery() *searchQuery
- type BoolQuery
- type Collapse
- type ConstScoreQuery
- type FieldSort
- type FieldValueFactor
- type FunctionScoreQuery
- type GeoBoundingBoxQuery
- type GeoDistanceQuery
- type GeoDistanceSort
- type GeoDistanceType
- type GeoPolygonQuery
- type MatchAllQuery
- type MatchPhraseQuery
- type MatchQuery
- type NestedFilter
- type NestedQuery
- type PrefixQuery
- type PrimaryKeySort
- type Query
- type QueryOperator
- type QueryType
- 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 ScoreModeType
- type ScoreSort
- type SearchQuery
- type Sort
- type SortMode
- type SortOrder
- type Sorter
- type TermQuery
- type TermsQuery
- type VariantType
- type VariantValue
- type WildcardQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPBForQuery ¶
func BuildPBForQuery(q Query) (*otsprotocol.Query, error)
func NewSearchQuery ¶
func NewSearchQuery() *searchQuery
Types ¶
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 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 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 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 )
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 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 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 ¶
- collapse.go
- query.go
- query_bool.go
- query_const_score.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
- 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.