Commit 5d5b4817 authored by 赵威's avatar 赵威

update sql

parent 3899ebbf
......@@ -125,10 +125,14 @@ def get_es_diary(keywords, city_tag_id=-1, version=False):
q["sort"] = sort_list
q["_source"] = {"includes": ["id", "second_demands"]}
es_res = es_query("diary", q, offset=0, size=500)
diary_ids = []
diary_pairs = []
for diary_info in es_res["hits"]["hits"]:
diary_ids.append(diary_info["_source"]["id"])
return diary_ids
sd = ""
second_demands = diary_info["_source"].get("second_demands", [])
if second_demands and len(second_demands) > 0:
sd = second_demands[0]
diary_pairs.append((diary_info["_source"]["id"], sd))
return diary_pairs
if __name__ == "__main__":
......
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