Commit ed6f8e27 authored by 李小芳's avatar 李小芳

修改mapping

parent 0cc65b9a
......@@ -80,6 +80,7 @@ def put_mapping(es, index_prefix, doc_type, mapping, delete=False):
doc_type=doc_type,
rw='write'
)
# delete mapping first it type exists
if cl.exists_type(index=index, doc_type=doc_type) and delete:
cl.delete_mapping(index=index, doc_type=doc_type)
......@@ -111,7 +112,9 @@ def put_mapping(es, index_prefix, doc_type, mapping, delete=False):
import copy
mapping_copy = copy.deepcopy(mapping)
mapping_copy = _mapping_modify(es, doc_type, mapping_copy)
print(index)
print(doc_type)
print(mapping_copy)
return cl.put_mapping(index=index, doc_type=doc_type, body=mapping_copy)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment