Commit 257e255e authored by 李小芳's avatar 李小芳

修改mapping

parent 40deceda
......@@ -57,7 +57,7 @@ class Command(BaseCommand):
raise CommandError(
'unknown type name, type must be one of [topic, tag, itemwiki, diary, service, doctor, user, _all],ItemWiki,newwiki')
if options['type'] in ['service','sku']:
if options['type'] in ['service', 'sku']:
es = get_talos_es()
else:
es = get_es()
......@@ -114,7 +114,7 @@ class Command(BaseCommand):
def work(self, es, index_prefix, doc_type, delete=False):
# create index if not exits
create_index(es=es, index_prefix=index_prefix, doc_type="_doc")
create_index(es=es, index_prefix=index_prefix, doc_type=doc_type)
m = load_mapping(doc_type=doc_type)
......@@ -127,6 +127,5 @@ class Command(BaseCommand):
doc_type = "service"
if doc_type == "service_ngram":
doc_type = "service"
print(put_mapping(es=es, index_prefix=index_prefix, doc_type=doc_type,
mapping=m, delete=delete))
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