Commit cf490ebc authored by 段英荣's avatar 段英荣

Merge branch 'similar_sort' into 'master'

modify

See merge request !170
parents 3e502a65 1cbd53d6
...@@ -299,9 +299,9 @@ class TopicUtils(object): ...@@ -299,9 +299,9 @@ class TopicUtils(object):
query_function_score["query"]["bool"]["minimum_should_match"] = 1 query_function_score["query"]["bool"]["minimum_should_match"] = 1
q["query"]["function_score"] = query_function_score q["query"]["function_score"] = query_function_score
q["collapse"] = { # q["collapse"] = {
"field": "user_id" # "field": "user_id"
} # }
q["_source"] = { q["_source"] = {
"includes":["id","group_id","offline_score","user_id","edit_tag_list"] "includes":["id","group_id","offline_score","user_id","edit_tag_list"]
} }
......
...@@ -127,9 +127,10 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query ...@@ -127,9 +127,10 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
else: else:
break break
if len(have_read_topic_id_list) > 10000: if len(have_read_topic_id_list) > 5000:
cut_len = len(have_read_topic_id_list) - 10000 cut_len = len(have_read_topic_id_list)-5000
have_read_topic_id_list = have_read_topic_id_list[cut_len:] have_read_topic_id_list = have_read_topic_id_list[cut_len:]
redis_dict = { redis_dict = {
"have_read_topic_list": json.dumps(have_read_topic_id_list), "have_read_topic_list": json.dumps(have_read_topic_id_list),
} }
......
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