【发布时间】:2015-10-16 03:01:24
【问题描述】:
使用 python 更新 API,我将一个字符串字段添加到我的 ES 索引文档中。 甚至我的映射也有这个:
"mappings" : {
"_default_": {
"dynamic_templates": [
{ "notanalyzed": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "not_analyzed"
}
}
}
]
},
新添加的字段仍在分析中。有人注意到同样的问题吗?
这是一段添加新列的python代码:
res = es.search(index=ind, body=st, size=2000)
for rec in res['hits']['hits']:
es.update(index=rec['_index'],doc_type=rec['_type'],id=rec['_id'], body={"doc": {"srcSite": sS}})
所以新添加的“srcSite”仍然以某种方式“分析”。我尝试将新字段显式添加到模板中,但这也无济于事。
【问题讨论】:
-
你的相关python代码是什么样子的?另外请分享一个示例文档和您的字符串字段的有效映射。
标签: python templates dynamic elasticsearch updates