Commit 7e8d5952 authored by 李小芳's avatar 李小芳

修改mapping

parent ad1bd16e
......@@ -114,12 +114,9 @@ class Command(BaseCommand):
def work(self, es, index_prefix, doc_type, delete=False):
# create index if not exits
print(index_prefix)
create_index(es=es, index_prefix=index_prefix, doc_type=doc_type)
m = load_mapping(doc_type=doc_type)
# reset doc_type for experiment index
if doc_type == "diary_norms_disable":
doc_type = "diary"
if doc_type == "sku_norms_disable":
......
......@@ -111,7 +111,10 @@ 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)
return cl.put_mapping(index=index, doc_type="_doc", body=mapping_copy)
print(mapping_copy)
print(index)
print(doc_type)
return cl.put_mapping(index=index, doc_type=doc_type, body=mapping_copy)
def alias_shift(es, alias, old_index, new_index):
......
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