Commit 78898a43 authored by 李小芳's avatar 李小芳

更新es的配置

parent f512050d
...@@ -184,10 +184,10 @@ class TypeInfo(object): ...@@ -184,10 +184,10 @@ class TypeInfo(object):
if not isinstance(es, (list, tuple,)): if not isinstance(es, (list, tuple,)):
es = [es] es = [es]
# index_type = self.type index_type = self.type
index_type = "_doc"
if self.type == 'newitemwiki' or self.type == 'collectwiki' or self.type == 'brandwiki' or self.type == 'productwiki': if self.type == 'newitemwiki' or self.type == 'collectwiki' or self.type == 'brandwiki' or self.type == 'productwiki':
index_type = '_doc' index_type = 'newwiki'
index = es_index_adapt( index = es_index_adapt(
index_prefix=index_prefix, index_prefix=index_prefix,
...@@ -201,7 +201,7 @@ class TypeInfo(object): ...@@ -201,7 +201,7 @@ class TypeInfo(object):
bulk_actions.append({ bulk_actions.append({
'_op_type': 'index', '_op_type': 'index',
'_index': index, '_index': index,
'_type': index_type, '_type': "_doc",
'_id': data['id'] + data["wikitype"] * 10000, '_id': data['id'] + data["wikitype"] * 10000,
'_source': data, '_source': data,
}) })
...@@ -210,7 +210,7 @@ class TypeInfo(object): ...@@ -210,7 +210,7 @@ class TypeInfo(object):
bulk_actions.append({ bulk_actions.append({
'_op_type': 'index', '_op_type': 'index',
'_index': index, '_index': index,
'_type': index_type, '_type': "_doc",
'_id': self.name + "_" + str(data["id"]), '_id': self.name + "_" + str(data["id"]),
'_source': data, '_source': data,
}) })
...@@ -229,7 +229,7 @@ class TypeInfo(object): ...@@ -229,7 +229,7 @@ class TypeInfo(object):
bulk_actions.append({ bulk_actions.append({
'_op_type': 'index', '_op_type': 'index',
'_index': index, '_index': index,
'_type': index_type, '_type': "_doc",
'_id': data['id'], '_id': data['id'],
'_source': data, '_source': data,
}) })
......
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