【发布时间】:2022-11-11 00:27:14
【问题描述】:
我正在编写将数据插入弹性索引的映射器,但出现以下错误。
elasticsearch.BadRequestError: BadRequestError(400, 'mapper_parsing_exception', 'not_x_content_exception: 压缩器检测只能在某些 xcontent 字节或压缩 xcontent 字节上调用')
mapper = {"mappings":
{
"event_info": {"type": "nested",
"properties": {
"type_info": {"type": "text"},
"op_type": {"type": "text"},
"file_name": {"type": "text"},
"file_ext": {"type": "text"},
"process_id": {"type": "text"},
"time_stamp": {"type": "text"}
}
}
}
}
data = [{'event_info': [{'type_info': 'INFO', 'op_type': 'WRITE', 'file_name': '0.txt', 'file_ext': '.txt', 'process_id': '1234', 'time_stamp': '2022-10-17 05:23:06.8620427 +0000 UTC'}]}]
需要为插入数据创建正确的映射器。任何帮助,将不胜感激。
【问题讨论】:
标签: python elasticsearch