Commit 5e5123c2 authored by lixiaofang's avatar lixiaofang

搜索画报

parent e2a54bc2
...@@ -247,7 +247,7 @@ class GroupUtils(object): ...@@ -247,7 +247,7 @@ class GroupUtils(object):
} }
} }
q["_source"] = { q["_source"] = {
"includes": ["id", "tag_name", "name", "description", "is_online", "is_cover", "topic_id_list", "includes": ["id", "is_online", "is_deleted", "is_default", "topic_id_list", "is_cover", "offline_score",
"is_default"] "is_default"]
} }
q["sort"] = [ q["sort"] = [
......
...@@ -111,8 +111,23 @@ def search_user(query="", offset=0, size=10): ...@@ -111,8 +111,23 @@ def search_user(query="", offset=0, size=10):
# 先获取完全匹配的用户ID # 先获取完全匹配的用户ID
sheer_user_id = [] sheer_user_id = []
q["query"] = { q["query"] = {
"term": { "bool": {
"nick_name_pre": query "must": [
{"term": {
"nick_name_pre": query
}
}, {
"term": {
"is_recommend": True
}
}
]
}
}
q["sort"] = {
"count_topic": {
"order": "desc"
} }
} }
# que = {"query": {"term": {"nick_name_pre": query}}} # que = {"query": {"term": {"nick_name_pre": query}}}
...@@ -148,7 +163,7 @@ def search_user(query="", offset=0, size=10): ...@@ -148,7 +163,7 @@ def search_user(query="", offset=0, size=10):
} }
q["sort"] = { q["sort"] = {
"is_recommend": { "is_recommend": {
"order": "asc" "order": "desc"
}, },
"count_topic": { "count_topic": {
"order": "desc" "order": "desc"
...@@ -171,4 +186,4 @@ def search_user(query="", offset=0, size=10): ...@@ -171,4 +186,4 @@ def search_user(query="", offset=0, size=10):
except: except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"search_user_id": []} return {"sheer_user_id": [], "search_user_id": []}
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