根据docs https://www.elastic.co/guide/en/elasticsearch/reference/2.4/ignore-malformed.html,这应该足够了:
"settings": {
"index.mapping.ignore_malformed": true
}
但是如何在 python 包装器上实现这一点呢?我当前的代码如下所示:
from elasticsearch_dsl import Index
index = Index('my_index', my_conn)
index.settings(
number_of_shards=ES_NUMBER_OF_SHARDS,
number_of_replicas=ES_NUMBER_OF_REPLICAS
)
index.create()
出奇,
index.settings(
index={'mapping':{'ignore_malformed':True}}
)
效果很好。我将把 Q 留在这里,因为可能有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)