ES_dsl.Q() 中 "path" 的功能是什么?

What's the functionality of "path" in ES_dsl.Q()?

我有一个声明:ES_dsl.Q('nested', path='student', query=nest_filter) "path"在上面的那个中起到什么样的作用呢?

path 只是您在查询中使用的嵌套字段的路径。

nest_filter 中,您需要将嵌套字段引用为 student.xyz

检查以下查询中的等价性:

GET /_search
{
    "query": {
        "nested" : {
            "path" : "student",           <--- this is the path
            "query" : {                   <--- this is nest_filter
                "bool" : {
                    { "match" : {"student.name" : "john"} },
                    { "range" : {"student.age" : {"gt" : 20}} }
                    ]
                }
            }
        }
    }
}