Commit a3f06082 authored by lixiaofang's avatar lixiaofang

add contrast_similar

parent c6f2ca06
......@@ -12,7 +12,7 @@ import elasticsearch
import elasticsearch.helpers
import sys
from trans2es.models import topic,user,pick_celebrity,group,celebrity,tag,contrast_similar
from trans2es.models import topic, user, pick_celebrity, group, celebrity, tag, contrast_similar
from trans2es.utils.user_transfer import UserTransfer
from trans2es.utils.pick_celebrity_transfer import PickCelebrityTransfer
from trans2es.utils.group_transfer import GroupTransfer
......@@ -161,7 +161,7 @@ class TypeInfo(object):
# traceback.print_exc()
# es_result = 'error'
return ESPerform.es_helpers_bulk(es,data_list,sub_index_name,True)
return ESPerform.es_helpers_bulk(es, data_list, sub_index_name, True)
def elasticsearch_bulk_insert(self, sub_index_name, instance_iterable, es=None):
data_list = self.bulk_get_data(instance_iterable)
......@@ -245,11 +245,11 @@ def get_type_info_map():
round_insert_period=2,
),
TypeInfo(
name = "user", #用户
name="user", # 用户
type="user",
model=user.User,
#query_deferred=lambda:user.User.objects.all().query,
#query_deferred=lambda: user.User.objects.prefetch_related('myuserfollow').query,
# query_deferred=lambda:user.User.objects.all().query,
# query_deferred=lambda: user.User.objects.prefetch_related('myuserfollow').query,
query_deferred=lambda: user.User.objects.all().query,
get_data_func=UserTransfer.get_user_data,
bulk_insert_chunk_size=100,
......
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