Documentation
¶
Index ¶
- Constants
- func FormatResponse(resp *meta.SearchResponse, q *meta.ZedQuery, buckets *search.Bucket) error
- func ParseQueryDSL(q *meta.ZedQuery, mappings *meta.Mappings, ...) (riot.SearchRequest, error)
- func ParseQueryDSLFromV1(q *v1.ZedQuery) (*meta.ZedQuery, error)
- func Rewrite(query interface{}, ...) (interface{}, error)
- func RewriteLimit() int
- type ExecFunc
Constants ¶
const MaxRewriteMatches = 65536
MaxRewriteMatches is hard limit of documents joined by single nested / has_child / has_parent clause.
Variables ¶
This section is empty.
Functions ¶
func FormatResponse ¶
func ParseQueryDSL ¶
func ParseQueryDSL(q *meta.ZedQuery, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (riot.SearchRequest, error)
ParseQueryDSL parse query DSL and return searchRequest
func ParseQueryDSLFromV1 ¶
ParseQueryDSLFromV1 parse query DSL from search v1 and return new zed query DSL
func Rewrite ¶
func Rewrite(query interface{}, exec func(sub map[string]interface{}, collectField string) ([]string, error)) (interface{}, error)
Rewrite replaces `nested`, `has_child`, `has_parent` and `parent_id` clauses of query DSL by plain term queries on hidden fields. Riot has no block join support, so joins are resolved in separate search pass (exec) and result is pushed back into query as list of document ids.
Clauses are rewritten as:
nested{path,query} -> terms _id of matching _nested_parent
has_child{type,query} -> terms _id of matching _join_parent
has_parent{type,query} -> terms _join_parent of matching _id
parent_id{type,id} -> _join_name + _join_parent terms
`score_mode` / `score` are accepted but ignored: joined documents get constant score, child scores are not propagated to parent.
func RewriteLimit ¶
func RewriteLimit() int
RewriteLimit returns maximum number of documents single join clause may match.
Types ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal/testutil
Package testutil holds helpers shared by the analysis test packages.
|
Package testutil holds helpers shared by the analysis test packages. |