Commit e84e4993 authored by lixiaofang's avatar lixiaofang

answer []

parent 2188b209
...@@ -107,8 +107,8 @@ def pictorial_topic(topic_id=-1, offset=0, size=10): ...@@ -107,8 +107,8 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
q["_source"] = { q["_source"] = {
"include": ["id", "pictorial_id", "tag_list"] "include": ["id", "pictorial_id", "tag_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, size)
logging.info("get result_dict:%s"%result_dict)
pict_pictorial_ids_list = [] pict_pictorial_ids_list = []
topic_tag_list = [] topic_tag_list = []
pictorial_id_list = [] pictorial_id_list = []
...@@ -116,8 +116,6 @@ def pictorial_topic(topic_id=-1, offset=0, size=10): ...@@ -116,8 +116,6 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
for item in result_dict["hits"]: for item in result_dict["hits"]:
pict_pictorial_ids_list = item["_source"]["pictorial_id"] pict_pictorial_ids_list = item["_source"]["pictorial_id"]
topic_tag_list = item["_source"]["tag_list"] topic_tag_list = item["_source"]["tag_list"]
logging.info("get pict_pictorial_ids_list:%s" % pict_pictorial_ids_list)
q["query"] = { q["query"] = {
"terms": { "terms": {
"id": pict_pictorial_ids_list "id": pict_pictorial_ids_list
...@@ -137,9 +135,9 @@ def pictorial_topic(topic_id=-1, offset=0, size=10): ...@@ -137,9 +135,9 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
for item in result_dict["hits"]: for item in result_dict["hits"]:
pictorial_id = item["_source"]["id"] pictorial_id = item["_source"]["id"]
pictorial_id_list.append(pictorial_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: if len(pict_pictorial_ids_list) < 10:
q["query"] = { q["query"] = {
"terms": { "terms": {
...@@ -155,7 +153,6 @@ def pictorial_topic(topic_id=-1, offset=0, size=10): ...@@ -155,7 +153,6 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
} }
} }
logging.info("get pictorial query:%s" % q)
result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, size) result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, size)
if len(result_dict["hits"]) > 0: if len(result_dict["hits"]) > 0:
pictorial_id_list.append(item["_source"]["id"] for item in result_dict["hits"]) # pictorial_id_list.append(item["_source"]["id"] for item in result_dict["hits"]) #
......
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