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

更新es的配置

parent a4192a46
...@@ -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 = 'newwiki' index_type = '_doc'
index = es_index_adapt( index = es_index_adapt(
index_prefix=index_prefix, index_prefix=index_prefix,
...@@ -333,7 +333,7 @@ def get_type_info_map(): ...@@ -333,7 +333,7 @@ def get_type_info_map():
type_info_list = [ type_info_list = [
TypeInfo( TypeInfo(
name='tag', # 圈子 name='tag', # 圈子
type='_doc', type='tag',
model=am.Tag, model=am.Tag,
query_deferred=lambda: am.Tag.objects.all().query, query_deferred=lambda: am.Tag.objects.all().query,
get_data_func=transfer.get_tag, get_data_func=transfer.get_tag,
...@@ -344,7 +344,7 @@ def get_type_info_map(): ...@@ -344,7 +344,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='tagv3', # 圈子 name='tagv3', # 圈子
type='_doc', type='tagv3',
model=TagV3, model=TagV3,
query_deferred=lambda: TagV3.objects.all().query, query_deferred=lambda: TagV3.objects.all().query,
get_data_func=transfer.get_tagv3, get_data_func=transfer.get_tagv3,
...@@ -355,7 +355,7 @@ def get_type_info_map(): ...@@ -355,7 +355,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='itemwiki', # 百科 name='itemwiki', # 百科
type='_doc', type='itemwiki',
model=am.ItemWiki, model=am.ItemWiki,
query_deferred=lambda: am.ItemWiki.objects.select_related('tag').query, query_deferred=lambda: am.ItemWiki.objects.select_related('tag').query,
get_data_func=transfer.get_itemwiki, get_data_func=transfer.get_itemwiki,
...@@ -367,7 +367,7 @@ def get_type_info_map(): ...@@ -367,7 +367,7 @@ def get_type_info_map():
TypeInfo( TypeInfo(
name='newitemwiki', # 项目百科tab name='newitemwiki', # 项目百科tab
type='_doc', type='newitemwiki',
model=item.NewItemWiki, model=item.NewItemWiki,
query_deferred=lambda: item.NewItemWiki.objects.all().query, query_deferred=lambda: item.NewItemWiki.objects.all().query,
get_data_func=WikiTab_transfer.get_ItemWiki, get_data_func=WikiTab_transfer.get_ItemWiki,
...@@ -378,7 +378,7 @@ def get_type_info_map(): ...@@ -378,7 +378,7 @@ def get_type_info_map():
TypeInfo( TypeInfo(
name='collectwiki', # 聚合百科tab name='collectwiki', # 聚合百科tab
type='_doc', type='collectwiki',
model=collect.CollectWiki, model=collect.CollectWiki,
query_deferred=lambda: collect.CollectWiki.objects.all().query, query_deferred=lambda: collect.CollectWiki.objects.all().query,
get_data_func=WikiTab_transfer.get_CollectWiki, get_data_func=WikiTab_transfer.get_CollectWiki,
...@@ -389,7 +389,7 @@ def get_type_info_map(): ...@@ -389,7 +389,7 @@ def get_type_info_map():
TypeInfo( TypeInfo(
name='brandwiki', # 品牌产品tab name='brandwiki', # 品牌产品tab
type='_doc', type='brandwiki',
model=brand.BrandWiki, model=brand.BrandWiki,
query_deferred=lambda: brand.BrandWiki.objects.all().query, query_deferred=lambda: brand.BrandWiki.objects.all().query,
get_data_func=WikiTab_transfer.get_BrandWiki, get_data_func=WikiTab_transfer.get_BrandWiki,
...@@ -400,7 +400,7 @@ def get_type_info_map(): ...@@ -400,7 +400,7 @@ def get_type_info_map():
TypeInfo( TypeInfo(
name='productwiki', # 产品百科tab name='productwiki', # 产品百科tab
type='_doc', type='productwiki',
model=product.ProductWiki, model=product.ProductWiki,
query_deferred=lambda: product.ProductWiki.objects.all().query, query_deferred=lambda: product.ProductWiki.objects.all().query,
get_data_func=WikiTab_transfer.get_ProductWiki, get_data_func=WikiTab_transfer.get_ProductWiki,
...@@ -410,7 +410,7 @@ def get_type_info_map(): ...@@ -410,7 +410,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='wiki_keyword', # 百科keyword name='wiki_keyword', # 百科keyword
type='_doc', type='wiki_keyword',
model=hot_wiki_keyword.Wiki_Keyword, model=hot_wiki_keyword.Wiki_Keyword,
query_deferred=lambda: hot_wiki_keyword.Wiki_Keyword.objects.all().query, query_deferred=lambda: hot_wiki_keyword.Wiki_Keyword.objects.all().query,
get_data_func=transfer.Wiki_keyword, get_data_func=transfer.Wiki_keyword,
...@@ -421,7 +421,7 @@ def get_type_info_map(): ...@@ -421,7 +421,7 @@ def get_type_info_map():
TypeInfo( TypeInfo(
name='diary', # 日记本 name='diary', # 日记本
type='_doc', type='diary',
model=Diary, model=Diary,
# WARNING: # WARNING:
# This code *MUST* be synchronized with trans2es.utils.transfer.get_diary # This code *MUST* be synchronized with trans2es.utils.transfer.get_diary
...@@ -440,7 +440,7 @@ def get_type_info_map(): ...@@ -440,7 +440,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='service', # 福利 name='service', # 福利
type='_doc', type='service',
model=am.Service, model=am.Service,
query_deferred=lambda: am.Service.objects.select_related('doctor__hospital__city__province').query, query_deferred=lambda: am.Service.objects.select_related('doctor__hospital__city__province').query,
get_data_func=service_transfer.get_service, get_data_func=service_transfer.get_service,
...@@ -450,7 +450,7 @@ def get_type_info_map(): ...@@ -450,7 +450,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='package', name='package',
type='_doc', type='package',
model=UnitRelateService, model=UnitRelateService,
query_deferred=lambda: UnitRelateService.objects.filter( query_deferred=lambda: UnitRelateService.objects.filter(
related_type=VisualUnitRelatedServiceType.PACKAGE).query, related_type=VisualUnitRelatedServiceType.PACKAGE).query,
...@@ -461,7 +461,7 @@ def get_type_info_map(): ...@@ -461,7 +461,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='package_promotion', name='package_promotion',
type='_doc', type='package_promotion',
model=SubmissionCommodity, model=SubmissionCommodity,
query_deferred=lambda: SubmissionCommodity.objects.all().query, query_deferred=lambda: SubmissionCommodity.objects.all().query,
get_data_func=package_promotion_transfer.get_promotion, get_data_func=package_promotion_transfer.get_promotion,
...@@ -471,7 +471,7 @@ def get_type_info_map(): ...@@ -471,7 +471,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='lbs', name='lbs',
type='_doc', type='lbs',
model=SubmissionCommodity, model=SubmissionCommodity,
query_deferred=lambda: SubmissionCommodity.objects.using(settings.POSEIDON_DB_NAME).all().query, query_deferred=lambda: SubmissionCommodity.objects.using(settings.POSEIDON_DB_NAME).all().query,
get_data_func=service_transfer.lbs_promotion_info, get_data_func=service_transfer.lbs_promotion_info,
...@@ -481,7 +481,7 @@ def get_type_info_map(): ...@@ -481,7 +481,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='lbs_clone', name='lbs_clone',
type='_doc', type='lbs_clone',
model=UnitRelateService, model=UnitRelateService,
query_deferred=lambda: UnitRelateService.objects.using(settings.POSEIDON_DB_NAME).all().query, query_deferred=lambda: UnitRelateService.objects.using(settings.POSEIDON_DB_NAME).all().query,
get_data_func=service_transfer.lbs_unit_info, get_data_func=service_transfer.lbs_unit_info,
...@@ -491,7 +491,7 @@ def get_type_info_map(): ...@@ -491,7 +491,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='sku', # sku name='sku', # sku
type='_doc', type='sku',
model=am.ServiceItem, model=am.ServiceItem,
query_deferred=lambda: am.ServiceItem.objects.select_related( query_deferred=lambda: am.ServiceItem.objects.select_related(
'service__doctor__hospital__city__province').query, 'service__doctor__hospital__city__province').query,
...@@ -502,7 +502,7 @@ def get_type_info_map(): ...@@ -502,7 +502,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='doctor', # 医生 name='doctor', # 医生
type='_doc', type='doctor',
model=am.Doctor, model=am.Doctor,
query_deferred=lambda: am.Doctor.objects query_deferred=lambda: am.Doctor.objects
.select_related('hospital__city__province') .select_related('hospital__city__province')
...@@ -516,7 +516,7 @@ def get_type_info_map(): ...@@ -516,7 +516,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='consultant', # 医生 name='consultant', # 医生
type='_doc', type='consultant',
model=counsellor.Counsellor, model=counsellor.Counsellor,
query_deferred=lambda: counsellor.Counsellor.objects.all().query, query_deferred=lambda: counsellor.Counsellor.objects.all().query,
get_data_func=consultation_transfer.get_consultant, get_data_func=consultation_transfer.get_consultant,
...@@ -526,7 +526,7 @@ def get_type_info_map(): ...@@ -526,7 +526,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='user', # 用户 name='user', # 用户
type='_doc', type='user',
model=am.User, model=am.User,
query_deferred=lambda: am.User.objects.select_related('userextra').query, query_deferred=lambda: am.User.objects.select_related('userextra').query,
get_data_func=user_transfer.get_user, get_data_func=user_transfer.get_user,
...@@ -536,7 +536,7 @@ def get_type_info_map(): ...@@ -536,7 +536,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='board', # 问答 name='board', # 问答
type='_doc', type='board',
model=RankBoard, model=RankBoard,
query_deferred=lambda: RankBoard.objects.prefetch_related('data_tags').query, query_deferred=lambda: RankBoard.objects.prefetch_related('data_tags').query,
get_data_func=board_transfer.get_board, get_data_func=board_transfer.get_board,
...@@ -546,7 +546,7 @@ def get_type_info_map(): ...@@ -546,7 +546,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name='user_album', # 用户相册 name='user_album', # 用户相册
type='_doc', type='user_album',
model=am.User, model=am.User,
query_deferred=lambda: am.User.objects.select_related('userextra').query, query_deferred=lambda: am.User.objects.select_related('userextra').query,
get_data_func=user_album_transfer.get_user_album, get_data_func=user_album_transfer.get_user_album,
...@@ -556,7 +556,7 @@ def get_type_info_map(): ...@@ -556,7 +556,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name="group", # 小组 name="group", # 小组
type="_doc", type="group",
model=Group, model=Group,
query_deferred=lambda: Group.objects.all().query, query_deferred=lambda: Group.objects.all().query,
get_data_func=group_transfer.get_group, get_data_func=group_transfer.get_group,
...@@ -566,7 +566,7 @@ def get_type_info_map(): ...@@ -566,7 +566,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name="topic", # 话题 name="topic", # 话题
type="_doc", type="topic",
model=Topic, model=Topic,
query_deferred=lambda: Topic.objects.all().query, query_deferred=lambda: Topic.objects.all().query,
get_data_func=grouptopic_transfer.get_topic, get_data_func=grouptopic_transfer.get_topic,
...@@ -576,7 +576,7 @@ def get_type_info_map(): ...@@ -576,7 +576,7 @@ def get_type_info_map():
), ),
TypeInfo( TypeInfo(
name="special", # 话题 name="special", # 话题
type="_doc", type="special",
model=SpecialPool, model=SpecialPool,
query_deferred=lambda: SpecialPool.objects.all().query, query_deferred=lambda: SpecialPool.objects.all().query,
get_data_func=special_transfer.get_special, get_data_func=special_transfer.get_special,
......
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