Commit 742bdca7 authored by 段英荣's avatar 段英荣

modify

parent a0695fe5
...@@ -204,7 +204,7 @@ class TopicUtils(object): ...@@ -204,7 +204,7 @@ class TopicUtils(object):
'fields': query_fields, 'fields': query_fields,
} }
query_function_score["query"]["bool"]["should"].append({'multi_match': multi_match}) query_function_score["query"]["bool"]["should"].append({'multi_match': multi_match})
query_function_score["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["_source"] = { q["_source"] = {
......
...@@ -27,7 +27,7 @@ def home_recommend(session_id="",user_id=-1,offset=0,size=10): ...@@ -27,7 +27,7 @@ def home_recommend(session_id="",user_id=-1,offset=0,size=10):
session_id = "" session_id = ""
redis_key = "physical:home_recommend" + ":user_id:" + str(user_id) + ":session_id:" + session_id redis_key = "physical:home_recommend" + ":user_id:" + str(user_id) + ":session_id:" + session_id
redis_val_dict = redis_client.hgetall(redis_key) redis_val_dict = redis_client.hgetall(redis_key)
last_offset_num = redis_val_dict["last_offset_num"] if "last_offset_num" in redis_val_dict else -1000 last_offset_num = redis_val_dict["last_offset_num"] if "last_offset_num" in redis_val_dict else -1
recommend_topic_ids = [] recommend_topic_ids = []
...@@ -91,7 +91,7 @@ def home_query(session_id="",user_id=-1,query="",offset=0,size=10): ...@@ -91,7 +91,7 @@ def home_query(session_id="",user_id=-1,query="",offset=0,size=10):
session_id = "" session_id = ""
redis_key = "physical:home_query" + ":user_id:" + str(user_id) + ":session_id:" + session_id redis_key = "physical:home_query" + ":user_id:" + str(user_id) + ":session_id:" + session_id
redis_val_dict = redis_client.hgetall(redis_key) redis_val_dict = redis_client.hgetall(redis_key)
last_offset_num = redis_val_dict["last_offset_num"] if "last_offset_num" in redis_val_dict else -1000 last_offset_num = redis_val_dict["last_offset_num"] if "last_offset_num" in redis_val_dict else -1
recommend_topic_ids = [] recommend_topic_ids = []
......
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