Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
physical
Commits
5e5123c2
Commit
5e5123c2
authored
May 30, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索画报
parent
e2a54bc2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
group.py
search/utils/group.py
+1
-1
user.py
search/views/user.py
+18
-3
No files found.
search/utils/group.py
View file @
5e5123c2
...
...
@@ -247,7 +247,7 @@ class GroupUtils(object):
}
}
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"
]
}
q
[
"sort"
]
=
[
...
...
search/views/user.py
View file @
5e5123c2
...
...
@@ -111,9 +111,24 @@ def search_user(query="", offset=0, size=10):
# 先获取完全匹配的用户ID
sheer_user_id
=
[]
q
[
"query"
]
=
{
"term"
:
{
"bool"
:
{
"must"
:
[
{
"term"
:
{
"nick_name_pre"
:
query
}
},
{
"term"
:
{
"is_recommend"
:
True
}
}
]
}
}
q
[
"sort"
]
=
{
"count_topic"
:
{
"order"
:
"desc"
}
}
# que = {"query": {"term": {"nick_name_pre": query}}}
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"user"
,
q
,
0
,
10
)
...
...
@@ -148,7 +163,7 @@ def search_user(query="", offset=0, size=10):
}
q
[
"sort"
]
=
{
"is_recommend"
:
{
"order"
:
"
a
sc"
"order"
:
"
de
sc"
},
"count_topic"
:
{
"order"
:
"desc"
...
...
@@ -171,4 +186,4 @@ def search_user(query="", offset=0, size=10):
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"search_user_id"
:
[]}
return
{
"s
heer_user_id"
:
[],
"s
earch_user_id"
:
[]}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment