Commit 3ce6f398 authored by 段英荣's avatar 段英荣

modify index mapping

parent 611bb111
...@@ -39,17 +39,16 @@ class Command(BaseCommand): ...@@ -39,17 +39,16 @@ class Command(BaseCommand):
if len(options["type"]): if len(options["type"]):
if type_name==options["type"]: if type_name==options["type"]:
ESPerform.put_index_mapping(es_cli, type_name, force_sync=True) # ESPerform.put_index_mapping(es_cli, type_name, force_sync=True)
official_index_name = ESPerform.get_official_index_name(type_name)
index_exists = es_cli.indices.exists(official_index_name)
if not index_exists:
logging.info("begin create [%s] index!" % type_name)
ESPerform.create_index(es_cli,type_name)
# official_index_name = ESPerform.get_official_index_name(type_name) logging.info("begin create [%s] mapping!" % type_name)
# index_exists = es_cli.indices.exists(official_index_name) ESPerform.put_index_mapping(es_cli,type_name,force_sync=True)
# if not index_exists:
# logging.info("begin create [%s] index and mapping!" % type_name)
# ESPerform.create_index(es_cli,type_name)
# ESPerform.put_index_mapping(es_cli,type_name)
# else:
# logging.warning("index:[%s] has already existing!" % type_name)
if len(options["indices_template"]): if len(options["indices_template"]):
......
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