gpt4 book ai didi

indexing - 如何创建排除特定字段的Elasticsearch索引别名

转载 作者:行者123 更新时间:2023-12-02 23:38:47 25 4
gpt4 key购买 nike

我正在使用Elasticsearch的索引别名在更完整的索引上创建受限 View ,以支持旧版搜索应用程序。这很好。但我也想从返回的结果中排除某些敏感字段(它们包含电子邮件地址,因此我们希望不进行收集。)

这是我所拥有的:

PUT full-index/_alias/restricted-index-alias
{
"_source": {
"exclude": [ "field_with_email" ]
},
"filter": {
"term": { "indexflag": "noindex" }
}
}

这适用于查询(我看不到field_with_email),过滤条件也适用(我得到了受限的索引),但是我仍然在索引别名的查询结果中看到field_with_email。

这应该工作吗?

(我不想在映射中从_source中排除,因为我还在使用部分更新;如果整个文档都在_source中可用,则这些更新会更容易。)

最佳答案

不,它不应该起作用,并且文档也不建议它应该起作用。

关于indexing - 如何创建排除特定字段的Elasticsearch索引别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26349705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com