Documentation ¶
Index ¶
- Variables
- func DayBucket(dt time.Time) int
- func Exists(field *gentypes.FieldType) interface{}
- func In(field *gentypes.FieldType, values []interface{}) interface{}
- func Nested(field *gentypes.FieldType, filter interface{}) *nested
- func Term(fieldName string, value interface{}) *term
- func Wildcard(field, value string) *wildcard
- type BoolFilter
- type BoolOccurrence
- type FilterGenerator
- type NestedQuery
- type RangeFilter
- type RangeQry
- type TypeValidator
Constants ¶
This section is empty.
Variables ¶
View Source
var MatchAll = &matchall{&struct{}{}}
MatchAll maps to the Elasticsearch "match_all" filter
View Source
var MatchNone = NotFilter(MatchAll)
MatchNone matches no documents.
View Source
var ( // MaxDepth specifies the depth at which we are certain the filter generator is in an endless loop // This *shouldn't* happen, but is better than a stack overflow MaxDepth = 1000 )
Functions ¶
func DayBucket ¶
copy-pasta from entity to avoid the import when we actually parameterize this we will need to do it differently anyway
func In ¶
In creates a new Elasticsearch terms filter
{"terms": {field: values}}
{ "nested": { "query": { "bool" : { "must" :[ {"term": { "k":fieldName}}, filter, ] } , "path":"path_to_obj" }}
func Nested ¶
Nested creates a new Elasticsearch nested filter
{ "nested": { "query": { "bool" : { "must" :[ {"term": { "k":fieldName}}, filter, ] } , "path":"path_to_obj" }}
Types ¶
type BoolFilter ¶
type BoolFilter struct { Occurs BoolOccurrence `json:"bool"` MinShouldMatch int `json:"minimum_should_match,omitempty"` }
func AndFilter ¶
func AndFilter(v []interface{}) *BoolFilter
func NotFilter ¶
func NotFilter(v interface{}) *BoolFilter
func OrFilter ¶
func OrFilter(v []interface{}) *BoolFilter
type BoolOccurrence ¶
type BoolOccurrence struct { Filter []interface{} `json:"filter,omitempty"` Should []interface{} `json:"should,omitempty"` MustNot interface{} `json:"must_not,omitempty"` }
type FilterGenerator ¶
type FilterGenerator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(ts time.Time, inc expr.Includer, s gentypes.SchemaColumns) *FilterGenerator
func (*FilterGenerator) Walk ¶
func (fg *FilterGenerator) Walk(stmt *rel.FilterStatement) (*gentypes.Payload, error)
type NestedQuery ¶
type NestedQuery struct { Query interface{} `json:"query"` Path string `json:"path"` }
type RangeFilter ¶
type RangeQry ¶
type RangeQry struct { GTE interface{} `json:"gte,omitempty"` LTE interface{} `json:"lte,omitempty"` GT interface{} `json:"gt,omitempty"` LT interface{} `json:"lt,omitempty"` }
type TypeValidator ¶
type TypeValidator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator(s gentypes.SchemaColumns) *TypeValidator
func (*TypeValidator) FilterValidate ¶
func (m *TypeValidator) FilterValidate(stmt *rel.FilterStatement) error
Click to show internal directories.
Click to hide internal directories.