elasticsearch. guide

Has Child Query

has_child 查询仅仅是将一个 has_child 过滤器包含进了一个 constant_score 中. 它的语法跟 has_child filter 是一样的:

{
    "has_child" : {
        "type" : "blog_tag"
        "query" : {
            "term" : {
                "tag" : "something"
            }
        }
    }
}    

Scope

A _scope can be defined on the filter allowing to run facets on the same scope name that will work against the child documents. For example:

{
    "has_child" : {
        "_scope" : "my_scope",
        "type" : "blog_tag"
        "query" : {
            "term" : {
                "tag" : "something"
            }
        }
    }
}    

内存考量

目前的实现方式是, 所有 _id 的值都会被载入了内存(堆)以便于更快的查找, 所以请确认有足够的内存来存放它们.

 
Fork me on GitHub