Commit 8ca59f88 authored by lixiaofang's avatar lixiaofang

change size

parent 55d23168
......@@ -68,7 +68,10 @@ class GroupUtils(object):
q["_source"] = {
"includes": ["id"]
}
result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, size)
MAX_LOAD = 100
sizes = max(size, MAX_LOAD)
result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, sizes)
pictorial_ids_list = []
if len(result_dict["hits"]) > 0:
......@@ -97,7 +100,7 @@ class GroupUtils(object):
}
}
topic_ids_list = []
result_dict = ESPerform.get_search_results(es_cli_obj, "topic", q, offset, size)
result_dict = ESPerform.get_search_results(es_cli_obj, "topic", q, offset, sizes)
if len(result_dict["hits"]) > 0:
topic_ids_list = [item["_source"]["id"] for item in result_dict["hits"]]
......@@ -105,7 +108,7 @@ class GroupUtils(object):
if len(topic_ids_list) > 5:
pictorial_del_ids_list.append(id)
return pictorial_del_ids_list
return pictorial_del_ids_list[offset:(offset+size)]
else:
return []
......@@ -136,10 +139,10 @@ class GroupUtils(object):
q["_source"] = {
"includes": ["attention_pictorial_id_list"]
}
# MAX_LOAD = 100
# sizes = max(size, MAX_LOAD)
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 = []
if len(result_dict["hits"]) > 0:
pictorial_ids_list = result_dict["hits"][0]["_source"]["attention_pictorial_id_list"]
......@@ -175,7 +178,7 @@ class GroupUtils(object):
if len(topic_ids_list) > 5:
pictorial_del_ids_list.append(id)
return pictorial_del_ids_list
return pictorial_del_ids_list[offset:(offset+size)]
else:
return []
......
......@@ -16,6 +16,5 @@
"tag_id":{"type":"long"},
"tag_name":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"},
"topic_id_list":{"type":"long"}
}
}
\ No newline at end of file
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