Documentation ¶
Overview ¶
_ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
Package common_filters provides the filters for the graphql endpoint for Weaviate
_ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildNew ¶
func BuildNew(path string) graphql.InputObjectConfigFieldMap
The filters common to Local->Get and Local->GetMeta queries.
Types ¶
type GeoRange ¶
type GeoRange struct { *models.GeoCoordinates Distance float32 }
GeoRange to be used with fields of type GeoCoordinates. Identifies a point and a maximum distance from that point.
type LocalFilter ¶
type LocalFilter struct {
Root *Clause
}
func ExtractFilters ¶
func ExtractFilters(args map[string]interface{}, rootClass string) (*LocalFilter, error)
Extract the filters from the arguments of a Local->Get or Local->GetMeta query.
type Operator ¶
type Operator int
const ( OperatorEqual Operator = 1 OperatorNotEqual Operator = 2 OperatorGreaterThan Operator = 3 OperatorGreaterThanEqual Operator = 4 OperatorLessThan Operator = 5 OperatorLessThanEqual Operator = 6 OperatorAnd Operator = 7 OperatorOr Operator = 8 OperatorNot Operator = 9 OperatorWithinGeoRange Operator = 10 )
type Path ¶
type Path struct { Class schema.ClassName Property schema.PropertyName // If nil, then this is the property we're interested in. // If a pointer to another Path, the constraint applies to that one. Child *Path }
Represents the path in a filter. Either RelationProperty or PrimitiveProperty must be empty (e.g. "").
func ParsePath ¶
ParsePath Parses the path It parses an array of strings in this format [0] ClassName -> The root class name we're drilling down from [1] propertyName -> The property name we're interested in.
func (*Path) GetInnerMost ¶
GetInnerMost recursively searches for child paths, only when no more children can be found will the path be returned