Commit 06270a1d authored by 李小芳's avatar 李小芳

更新es的配置

parent 264b3280
...@@ -49,7 +49,7 @@ def get_type_info_map(): ...@@ -49,7 +49,7 @@ def get_type_info_map():
__type_info_map = { __type_info_map = {
'question': TypeInfo( 'question': TypeInfo(
name='question', # 问答 name='question', # 问答
type='_doc', type='question',
model=Question, model=Question,
bulk_insert_chunk_size=50, bulk_insert_chunk_size=50,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -60,7 +60,7 @@ def get_type_info_map(): ...@@ -60,7 +60,7 @@ def get_type_info_map():
), ),
'topic': TypeInfo( 'topic': TypeInfo(
name='topic', # 帖子 name='topic', # 帖子
type='_doc', type='topic',
model=Problem, model=Problem,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -71,7 +71,7 @@ def get_type_info_map(): ...@@ -71,7 +71,7 @@ def get_type_info_map():
), ),
'answer': TypeInfo( 'answer': TypeInfo(
name="answer", name="answer",
type="_doc", type="answer",
model=Answer, model=Answer,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -81,7 +81,7 @@ def get_type_info_map(): ...@@ -81,7 +81,7 @@ def get_type_info_map():
), ),
'article': TypeInfo( 'article': TypeInfo(
name="article", name="article",
type="_doc", type="article",
model=Article, model=Article,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -91,7 +91,7 @@ def get_type_info_map(): ...@@ -91,7 +91,7 @@ def get_type_info_map():
), ),
'subscript_article': TypeInfo( 'subscript_article': TypeInfo(
name="subscript_article", name="subscript_article",
type="_doc", type="subscript_article",
model=SubscriptArticle, model=SubscriptArticle,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -101,7 +101,7 @@ def get_type_info_map(): ...@@ -101,7 +101,7 @@ def get_type_info_map():
), ),
'qa_top': TypeInfo( 'qa_top': TypeInfo(
name="qa_top", name="qa_top",
type="_doc", type="qa_top",
model=AnswerTop, model=AnswerTop,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -111,7 +111,7 @@ def get_type_info_map(): ...@@ -111,7 +111,7 @@ def get_type_info_map():
), ),
'tractate': TypeInfo( 'tractate': TypeInfo(
name="tractate", name="tractate",
type="_doc", type="tractate",
model=Tractate, model=Tractate,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -121,7 +121,7 @@ def get_type_info_map(): ...@@ -121,7 +121,7 @@ def get_type_info_map():
), ),
'live_stream': TypeInfo( 'live_stream': TypeInfo(
name="live_stream", name="live_stream",
type="_doc", type="live_stream",
model=LiveStream, model=LiveStream,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -131,7 +131,7 @@ def get_type_info_map(): ...@@ -131,7 +131,7 @@ def get_type_info_map():
), ),
'live_notice': TypeInfo( 'live_notice': TypeInfo(
name="live_notice", name="live_notice",
type="_doc", type="live_notice",
model=ZhiboConfig, model=ZhiboConfig,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -141,7 +141,7 @@ def get_type_info_map(): ...@@ -141,7 +141,7 @@ def get_type_info_map():
), ),
'principal_activity': TypeInfo( 'principal_activity': TypeInfo(
name="principal_activity", name="principal_activity",
type="_doc", type="principal_activity",
model=Activity, model=Activity,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -151,7 +151,7 @@ def get_type_info_map(): ...@@ -151,7 +151,7 @@ def get_type_info_map():
), ),
'principal_article': TypeInfo( 'principal_article': TypeInfo(
name="principal_article", name="principal_article",
type="_doc", type="principal_article",
model=Problem, model=Problem,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -161,7 +161,7 @@ def get_type_info_map(): ...@@ -161,7 +161,7 @@ def get_type_info_map():
), ),
'video_tractate': TypeInfo( 'video_tractate': TypeInfo(
name="video_tractate", name="video_tractate",
type="_doc", type="video_tractate",
model=SoftArticle, model=SoftArticle,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -171,7 +171,7 @@ def get_type_info_map(): ...@@ -171,7 +171,7 @@ def get_type_info_map():
), ),
'word_tractate': TypeInfo( 'word_tractate': TypeInfo(
name="word_tractate", name="word_tractate",
type="_doc", type="word_tractate",
model=SoftArticle, model=SoftArticle,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -181,7 +181,7 @@ def get_type_info_map(): ...@@ -181,7 +181,7 @@ def get_type_info_map():
), ),
'doctortractate': TypeInfo( 'doctortractate': TypeInfo(
name="doctortractate", name="doctortractate",
type="_doc", type="doctortractate",
model=SoftArticle, model=SoftArticle,
bulk_insert_chunk_size=500, bulk_insert_chunk_size=500,
round_insert_chunk_size=50, round_insert_chunk_size=50,
...@@ -243,7 +243,7 @@ class TypeInfo(object): ...@@ -243,7 +243,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["principal_type"] * 10000000, '_id': data['id'] + data["principal_type"] * 10000000,
'_source': data, '_source': data,
}) })
...@@ -252,7 +252,7 @@ class TypeInfo(object): ...@@ -252,7 +252,7 @@ class TypeInfo(object):
bulk_actions.append({ bulk_actions.append({
'_op_type': 'index', '_op_type': 'index',
'_index': index, '_index': index,
'_type': self.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