Documentation
¶
Index ¶
- func BoolQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func BoostingQuery(query map[string]interface{}) (riot.Query, error)
- func CombinedFieldsQuery(query map[string]interface{}) (riot.Query, error)
- func ConstantScoreQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func DisMaxQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func ExistsQuery(query map[string]interface{}) (riot.Query, error)
- func FunctionScoreQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func FuzzyQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func GeoBoundingBoxQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func GeoDistanceQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func GeoPolygonQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func GeoShapeQuery(query map[string]interface{}) (riot.Query, error)
- func HasChildQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func HasParentQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func IdsQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func KnnQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func MatchAllQuery() (riot.Query, error)
- func MatchBoolPrefixQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func MatchNoneQuery() (riot.Query, error)
- func MatchPhrasePrefixQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func MatchPhraseQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func MatchQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func MultiMatchQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func NestedQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func ParentIDQuery(query map[string]interface{}) (riot.Query, error)
- func ParseFuzziness(fuzziness interface{}, query string, zer *analysis.Analyzer) int
- func PrefixQuery(query map[string]interface{}) (riot.Query, error)
- func Query(query interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func QueryStringQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func RangeQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func RangeQueryNumeric(field string, query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func RangeQueryTime(field string, query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func RegexpQuery(query map[string]interface{}) (riot.Query, error)
- func SimpleQueryStringQuery(query map[string]interface{}, mappings *meta.Mappings, ...) (riot.Query, error)
- func TermQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func TermQueryBool(field string, value *meta.TermQuery) (riot.Query, error)
- func TermQueryNumeric(field string, value *meta.TermQuery) (riot.Query, error)
- func TermQueryText(field string, value *meta.TermQuery) (riot.Query, error)
- func TermsQuery(query map[string]interface{}, mappings *meta.Mappings) (riot.Query, error)
- func TermsSetQuery(query map[string]interface{}) (riot.Query, error)
- func WildcardQuery(query map[string]interface{}) (riot.Query, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedFieldsQuery ¶
func ConstantScoreQuery ¶
func ConstantScoreQuery(query map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (riot.Query, error)
ConstantScoreQuery wraps a filter query and gives every matching document the same score (`boost`, default 1.0), like Elasticsearch's constant_score.
func DisMaxQuery ¶
func DisMaxQuery(query map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (riot.Query, error)
DisMaxQuery returns documents matching at least one of the given queries.
riot has no disjunction-max searcher, so this is approximated with a boolean should query with minimum_should_match=1. Matching documents are therefore scored with the SUM of the matching clause scores instead of the maximum one; `tie_breaker` is accepted for API compatibility but is not applied to scoring. The matched document set is identical to Elasticsearch's dis_max, only the relative ordering of multi-clause matches can differ.
func FunctionScoreQuery ¶
func FunctionScoreQuery(query map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (riot.Query, error)
FunctionScoreQuery modifies score of wrapped query with one or more scoring functions: weight, field_value_factor, random_score and decay functions (gauss, exp, linear). `script_score` is not supported.
func FuzzyQuery ¶
func GeoBoundingBoxQuery ¶
GeoBoundingBoxQuery parses:
{"location": {"top_left": {"lat": 40.73, "lon": -74.1}, "bottom_right": {"lat": 40.01, "lon": -71.12}}}
{"location": {"top": 40.73, "left": -74.1, "bottom": 40.01, "right": -71.12}}
func GeoDistanceQuery ¶
GeoDistanceQuery parses:
{"distance": "12km", "location": {"lat": 40, "lon": -70}}
func GeoPolygonQuery ¶
GeoPolygonQuery parses:
{"location": {"points": [{"lat": 40, "lon": -70}, [-80, 30], "20,-90"]}}
func HasChildQuery ¶
func HasChildQuery(query map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (riot.Query, error)
HasChildQuery matches child documents of join relation `type`.
Parents are resolved by uquery.Rewrite before query is parsed: it replaces whole clause by list of `_join_parent` ids. Parsing clause directly (no rewrite pass) returns matching child documents themselves. `min_children` / `max_children` are only honoured by rewrite pass.
func HasParentQuery ¶
func HasParentQuery(query map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (riot.Query, error)
HasParentQuery matches parent documents of join relation `parent_type`.
Children are resolved by uquery.Rewrite before query is parsed: it replaces whole clause by terms query on `_join_parent`. Parsing clause directly (no rewrite pass) returns matching parent documents themselves.
func KnnQuery ¶
KnnQuery parses an exact k-nearest-neighbours query over a vector field. As in Elasticsearch, k is the number of neighbours per shard; use size to cap the merged hits. Elasticsearch form:
{"field": "embedding", "query_vector": [0.1, 0.2], "k": 5, "similarity": "cosine", "boost": 2}
OpenSearch form:
{"embedding": {"vector": [0.1, 0.2], "k": 5}}
func MatchAllQuery ¶
func MatchBoolPrefixQuery ¶
func MatchNoneQuery ¶
func MatchPhrasePrefixQuery ¶
func MatchPhraseQuery ¶
func MatchQuery ¶
func MultiMatchQuery ¶
func NestedQuery ¶
func NestedQuery(query map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (riot.Query, error)
NestedQuery matches hidden documents of nested property, ie documents tagged with `_nested_path` equal to `path`.
Root documents are resolved by uquery.Rewrite before query is parsed: it replaces whole clause by list of `_nested_parent` ids. Parsing clause directly (no rewrite pass) therefore returns hidden nested documents themselves, which is what nested aggregations and sub searches need.
func ParentIDQuery ¶
ParentIDQuery matches child documents of relation `type` that point to given parent `id`. It needs no rewrite pass, hidden join fields hold everything query requires.
func ParseFuzziness ¶
func QueryStringQuery ¶
func RangeQuery ¶
func RangeQueryNumeric ¶
func RangeQueryTime ¶
func SimpleQueryStringQuery ¶
func TermQueryNumeric ¶
func TermsQuery ¶
Types ¶
This section is empty.
Source Files
¶
- bool.go
- boosting.go
- combined_fields.go
- constant_score.go
- dis_max.go
- exists.go
- function_score.go
- fuzzy.go
- geo.go
- ids.go
- join.go
- match.go
- match_all.go
- match_bool_prefix.go
- match_none.go
- match_phrase.go
- match_phrase_prefix.go
- multi_match.go
- nested.go
- prefix.go
- query.go
- query_string.go
- range.go
- regexp.go
- simple_query_string.go
- term.go
- terms.go
- terms_set.go
- vector.go
- wildcard.go