【发布时间】:2016-07-05 02:51:00
【问题描述】:
我必须使用 elasticsearch 和 python 为需要索引的 json 数据创建索引示例我有一个嵌套数组数组 [[39.909971141540645, 1452077285.150548, 1452077286.196072, 1.0455241203308105]] 我需要为这个数组定义一个映射,比如第一个字段是 count ,第二个字段是 start_time, end_time, duration 。请帮助如何声明嵌套数组的映射。
我已经声明了使用 python 和 elasticsearch 模块的映射
index_mapping={
"properties": {
"speed_events":{
"type":"object",
"properties":{
"count":{"type":"double"},
"start_time":{"type":"date"},
"end_time":{"type":"date"},
"duration":{"type":"double"}
}}}
es.indices.put_mapping(index=index_name, doc_type=type_name, body=index_mapping)
[speed_events] 的抛出错误对象映射试图将字段 [null] 解析为对象,但找到了具体值') 需要帮助来解决这个问题
【问题讨论】:
标签: python arrays json elasticsearch schema