elasticsearch - 具有源过滤的弹性搜索搜索忽略排除
问题描述
我有一个看起来很像下面的查询。出于某种原因,ES 6.4 忽略了源过滤器并返回所有内容。
有人有线索吗?
curl -X GET -H "Content-Type: application/json" http://localhost:49153/indexundertest/sometype/_search -d '{
"query":{
"bool":{
"filter":[
{
"terms":{
"_id":[
"AA001"
],
"boost":1.0
}
}
],
"adjust_pure_negative":true,
"boost":1.0
}
},
"_source":{
"includes":[
],
"excludes":[
"content.es",
"content.pt",
"content.zh",
"content.vi",
"other.content.es",
"other.content.pt",
"other.content.zh",
"other.content.vi"
]
}
}'
解决方案
看起来这是映射的问题。
如果我在没有映射的情况下创建索引,则使用源过滤的查询将按预期工作。如果我包含映射,我会在源代码中看到一个奇怪的结果。它在命中的源字段的键中包含源的内容,但具有“JSON”作为值。
正在修复我的映射。
推荐阅读
- android - 有什么方法可以检测用户关闭 WIFI 或数据的确切时间?
- c# - 为 AspNet 身份令牌设置计数器
- ruby - 使 ruby 可用于 Debian9 映像的问题
- php - 如何在 wordpress 网站的主页上传输 GET 请求?
- allure - 使用 Jenkins 的倾城报告显示错误的数据
- r - 如何修复“数学函数的非数字参数”
- database - Oracle DB 中的任何日志/审计表都包含用于审计目的的每日事务详细信息?
- r - 如何滞后和计算列表中每个数据框的差异?
- javascript - Datepicker CSS 已加载,但似乎未应用
- spring-boot - Gitlab ci - 工件应用程序 jar 的差异