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) *wildcardquery
- type BoolFilter
- type BoolOccurrence
- type FilterGenerator
- type NestedFilter
- type RangeFilter
- type RangeQry
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 Nested ¶
In creates a new Elasticsearch nested filter
{ "nested": { "filter": {"and":[ {"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 NestedFilter ¶
type NestedFilter struct { Filter interface{} `json:"filter"` Path string `json:"path"` }
type RangeFilter ¶
Click to show internal directories.
Click to hide internal directories.