Documentation
¶
Overview ¶
Contextual Query Language (CQL) syntax tree API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoolClause ¶
Represents a boolean clause (expression). The `Left`, `Right` and `Operator` fields should be initialized. When the operator is not set, `and` will be used during stringification.
func (*BoolClause) String ¶
func (bc *BoolClause) String() string
type Clause ¶
type Clause struct {
PrefixMap []Prefix
SearchClause *SearchClause
BoolClause *BoolClause
}
Represents either a search or a boolean clause (expression). Exactly one pointer field should be set when creating this struct. When neither pointer is set, the clause will stringify to `cql.allRecords = 1` (a special expression matching all records).
type CqlModifier ¶
type CqlModifier string
CQL built-in modifiers.
const ( Stem CqlModifier = "stem" //relation/sort, apply stemming to terms Relevant CqlModifier = "relevant" //relation/sort, apply relevancy matching Phonetic CqlModifier = "phonetic" //relation/sort, match words sounding like term Fuzzy CqlModifier = "fuzzy" //relation/sort, fuzzy matching Partial CqlModifier = "partial" //relation/sort, used with `within`/`encloses` IgnoreCase CqlModifier = "ignoreCase" //relation/sort, match case-insensitive RespectCase CqlModifier = "respectCase" //relation/sort, match case-sensitive IgnoreAccents CqlModifier = "ignoreAccents" //relation/sort, match w/o diacritics RespectAccents CqlModifier = "respectAccents" //relation/sort, match with diacritics Locale CqlModifier = "locale" //relation/sort, set locale, e.g `locale=da_DK` Word CqlModifier = "word" //relation/sort, break term into words String CqlModifier = "string" //relation/sort, treat term as a string IsoDate CqlModifier = "isoDate" //relation/sort, term is an ISO date, e.g `2000-10-31T01:30:00.000-05:00` Number CqlModifier = "number" //relation/sort, term is a number Uri CqlModifier = "uri" //relation/sort, term is a URI Oid CqlModifier = "oid" //relation/sort, terms is a ISO Object Identifier (OID), e.g `1.2.840.10003.3.1` Masked CqlModifier = "masked" //relation, on by default, * - zero/more chars, ? - single char, ^ - word anchor, \ - escape char, e.g `dc.title adj "*fish food*“ Unmasked CqlModifier = "unmasked" //relation, disable masking Substring CqlModifier = "substring" //relation, match range of chars, e.g `marc.008 =/substring="1:6" 920102` Regexp CqlModifier = "regexp" //relation, term is a regular expression Distance CqlModifier = "distance" //proximity, distance expression e.g `cat prox/distance>2 hat` Unit CqlModifier = "unit" //proximity, unit for distance, one of paragraph, sentence, word (default), element Unordered CqlModifier = "unordered" //proximity, order of terms is unimportant Ordered CqlModifier = "ordered" //proximity, order of terms is important )
type Modifier ¶
Represents a relation or a boolean operator modifier. At least `Name` should be set otherwise the struct will stringify to an empty quoted string. If `Relation` is not set but `Value` is, the `=` will be used during stringification.
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
Indicates query parsing error
func (*ParseError) Marked ¶
func (e *ParseError) Marked() string
Query with the error position marked
type Parser ¶
type Parser struct {
Strict bool //if true, multi term values, e.g. `a b c` are not allowed
// contains filtered or unexported fields
}
CQL parser, non-strict by default
type Prefix ¶
Represents a prefix declaration. The Prefix field can be omitted. The Uri field should be set or the struct will stringify to an empty quoted string.
type Query ¶
Represents the top-level CQL query. The `Clause“ field should be provided upon initialization. the `SortSpec` field is optional.
type SearchClause ¶
Represents a search clause (expression). When no `Index` is given the `cql.serverChoice` is used during stringification. when no `Relation` is given the `=` (aka `scr`) is used during stringification.
func (*SearchClause) String ¶
func (sc *SearchClause) String() string