Commit 780ac9f2 authored by lixiaofang's avatar lixiaofang

change pictorial sort

parent 35d50143
...@@ -48,6 +48,7 @@ class GroupUtils(object): ...@@ -48,6 +48,7 @@ class GroupUtils(object):
@classmethod @classmethod
def get_hot_pictorial_recommend_result_list(cls, offset, size, es_cli_obj=None): def get_hot_pictorial_recommend_result_list(cls, offset, size, es_cli_obj=None):
try: try:
if not es_cli_obj: if not es_cli_obj:
es_cli_obj = ESPerform.get_cli() es_cli_obj = ESPerform.get_cli()
...@@ -67,8 +68,9 @@ class GroupUtils(object): ...@@ -67,8 +68,9 @@ class GroupUtils(object):
q["_source"] = { q["_source"] = {
"includes": ["id"] "includes": ["id"]
} }
MAX_LOAD = 100
result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, size) sizes = max(size, MAX_LOAD)
result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, sizes)
pictorial_ids_list = [] pictorial_ids_list = []
if len(result_dict["hits"]) > 0: if len(result_dict["hits"]) > 0:
...@@ -137,8 +139,10 @@ class GroupUtils(object): ...@@ -137,8 +139,10 @@ class GroupUtils(object):
q["_source"] = { q["_source"] = {
"includes": ["attention_pictorial_id_list"] "includes": ["attention_pictorial_id_list"]
} }
MAX_LOAD = 100
sizes = max(size, MAX_LOAD)
result_dict = ESPerform.get_search_results(es_cli_obj, "user", q, offset, size) result_dict = ESPerform.get_search_results(es_cli_obj, "user", q, offset, sizes)
pictorial_ids_list = [] pictorial_ids_list = []
if len(result_dict["hits"]) > 0: if len(result_dict["hits"]) > 0:
pictorial_ids_list = result_dict["hits"][0]["_source"]["attention_pictorial_id_list"] pictorial_ids_list = result_dict["hits"][0]["_source"]["attention_pictorial_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