Commit 50890ac3 authored by lixiaofang's avatar lixiaofang

add

parent 22ffe30b
......@@ -135,14 +135,25 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
for item in result_dict["hits"]:
pictorial_id = item["_source"]["id"]
pictorial_id_list.append(pictorial_id)
logging.info("get result_dict:%s"%pictorial_id_list)
logging.info("get result_dict:%s"%pictorial_id_list)
logging.info("get pictorial_id_list:%s"%pictorial_id_list)
logging.info("get topic_tag_list:%s"%topic_tag_list)
if len(pict_pictorial_ids_list) < 10:
q["query"] = {
"terms": {
"tag_id": topic_tag_list
"bool":{
"must":{
"term": {
"is_online": True
},
"term": {
"is_delete": False
},
"terms": {
"tag_id": topic_tag_list
}
}
}
}
q["_source"] = {
"include": ["id", "tag_id"]
......@@ -157,6 +168,9 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
if len(result_dict["hits"]) > 0:
pictorial_id_list.append(item["_source"]["id"] for item in result_dict["hits"]) #
logging.info("get result_dict tag:%s" % result_dict)
return {"pictorial_ids_list": pictorial_id_list}
else:
......
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