Commit bba001c2 authored by lixiaofang's avatar lixiaofang

add test

parent 3127f350
......@@ -185,17 +185,23 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
}}
q["from"] = 0
q["size"] = num
q["size"] = 10
result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, size)
if len(result_dict["hits"]) > 0:
pictorial_id_list.append(item["_source"]["id"] for item in result_dict["hits"]) #
for item in result_dict["hits"]:
# id = item["_source"]["id"]
id = [1,2,3,4,5,6,7]
if id not in pictorial_id_list:
pictorial_id_list.append(id) #
logging.info("get result_dict tag:%s" % result_dict)
logging.info("get pictorial_id_list tag:%s" % pictorial_id_list)
return {"pictorial_ids_list": pictorial_id_list}
pictorial_list = pictorial_id_list if len(pictorial_id_list) < 10 else pictorial_id_list[:10]
return {"pictorial_ids_list": pictorial_list}
else:
return {"pictorial_ids_list": 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