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

修改mapping

parent ad283540
......@@ -114,6 +114,7 @@ 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)
......
......@@ -36,11 +36,11 @@ def create_index(es, index_prefix, doc_type):
cl = es.indices
index = es_index_adapt(
index_prefix=index_prefix,
doc_type="_doc"
doc_type=doc_type
)
if not cl.exists(index=index):
cl.create(index=index)
init_alias(es, index_prefix, "_doc")
init_alias(es, index_prefix, doc_type)
return True
else:
return False
......
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