如何禁用base64存储ingest-attachment elasticsearch插件?

问题描述 投票:2回答:1

documentation显示了如何通过ingest-attachment插件将base64文档存储到elasticsearch中的示例。但在此之后,我得到的elasticsearch索引包含已解析的文本和base64字段源。为什么需要?有没有办法删除base64文本字段,只保留文档索引后的文本而不是内容?

elasticsearch indexing full-text-search full-text-indexing data-ingestion
1个回答
0
投票

没有选项,但您可以在摄取管道中添加“删除”处理器:

PUT _ingest/pipeline/attachment
{
    "description": "Extract attachment information and remove the source encoded data",
    "processors": [
        {
            "attachment": {
                "field": "data",
                "properties": [
                    "content",
                    "content_type",
                    "content_length"
                ]
            }
        },
        {
            "remove": {
                "field": "data"
            }
        }
    ]
}
© www.soinside.com 2019 - 2024. All rights reserved.