Commit c0fbdded authored by 段英荣's avatar 段英荣

modify

parent 334cd997
...@@ -206,9 +206,20 @@ class TopicUtils(object): ...@@ -206,9 +206,20 @@ class TopicUtils(object):
q["query"]["function_score"] = query_function_score q["query"]["function_score"] = query_function_score
q["_source"] = { q["_source"] = {
"include":["id","group_id"] "include":["id","group_id","offline_score"]
} }
q["sort"] = [
{
"_script":{
"type":"number",
"script":{
"lang":"painless",
"source":"_score+params._source.offline_score"
},
"order":"desc"
}
}
]
result_dict = ESPerform.get_search_results(ESPerform.get_cli(), sub_index_name="topic", query_body=q, result_dict = ESPerform.get_search_results(ESPerform.get_cli(), sub_index_name="topic", query_body=q,
offset=offset, size=size) offset=offset, size=size)
......
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