elasticsearch - ES_dsl.Q()中 “path”的功能是什么?

标签 elasticsearch elasticsearch-dsl

我有一个声明:ES_dsl.Q('nested', path='student', query=nest_filter)“路径”在上述路径中扮演什么样的角色?

最佳答案

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}} }
                    ]
                }
            }
        }
    }
}

关于elasticsearch - ES_dsl.Q()中 “path”的功能是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52400808/

相关文章:

python - 利用Elasticsearch dsl python分析api

elasticsearch - 按查询删除不起作用

python - 为什么使用MinHash分析器的查询无法检索重复项?

Elasticsearch,嵌套对象的存在过滤器不起作用

elasticsearch - 嵌套查询是否用于ElasticSearch中的对象映射?

Elasticsearch 术语与匹配

elasticsearch - Elasticsearch:过滤符合条件的字段

Elasticsearch Shield 插件 - 即使具有管理员权限的用户也无法对用户进行身份验证

elasticsearch - 如何为Kibana 5.6.3创建插件

elasticsearch - 在elasticsearch中对缓存的搜索查询进行分页