Commit 22ffe30b authored by lixiaofang's avatar lixiaofang

add logging

parent e84e4993
...@@ -720,11 +720,15 @@ class TopicUtils(object): ...@@ -720,11 +720,15 @@ class TopicUtils(object):
if sorts: if sorts:
q["sort"] = sorts q["sort"] = sorts
logging.info("get query:%s"%q)
try: try:
result_dict = ESPerform.get_search_results( result_dict = ESPerform.get_search_results(
ESPerform.get_cli(), sub_index_name=index_name, ESPerform.get_cli(), sub_index_name=index_name,
query_body=q, offset=offset, size=size query_body=q, offset=offset, size=size
) )
logging.info("get result_dicts:%s" % result_dict)
return { return {
"hits": result_dict["hits"], "hits": result_dict["hits"],
......
...@@ -324,6 +324,7 @@ def topic_search(filters, nfilters=None, sorts_by=None, offset=0, size=10): ...@@ -324,6 +324,7 @@ def topic_search(filters, nfilters=None, sorts_by=None, offset=0, size=10):
try: try:
result_list = TopicUtils.list_topic_ids(filters=filters, nfilters=nfilters, result_list = TopicUtils.list_topic_ids(filters=filters, nfilters=nfilters,
sorts_by=sorts_by, offset=offset, size=size) sorts_by=sorts_by, offset=offset, size=size)
logging.info("get result_list:%s"%result_list)
topic_ids = [item["_source"]["id"] for item in result_list["hits"]] topic_ids = [item["_source"]["id"] for item in result_list["hits"]]
return { return {
"topic_ids": topic_ids, "topic_ids": topic_ids,
......
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