我面临一个问题:
这导致我去寻求描述here的解决方案。
我当前产生上述错误的代码是:
from test_mapping import a
es = Elasticsearch([{'host': 'A.B.C.D', 'port': 9200}])
try:
es.index(index='datatables', doc_type='datatable_v1', id="pallet_d3dd6729b810bebd955708e85afc1f65c3f2685c", body=a)
except Exception as e:
print (e)
该索引以前已经存在,但是我已将其删除,然后运行上面的代码仍会生成上述错误。变量
a
是here 最佳答案
使用它来加载:
import simplejson
es.index(index='datatables', doc_type = 'datatable_v1', id = "pallet_d3dd6729b810bebd955708e85afc1f65c3f2685c", body = simplejson.dumps(a, ignore_nan = True))
这应该可以解决您的问题。现在,您的应用程序将将此值读取为None(可能是此损坏的根源),您可以轻松实现功能