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
alpha
physical
Commits
394e5924
Commit
394e5924
authored
Mar 18, 2019
by
zhanglu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a8c37320
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
25 deletions
+30
-25
topic.py
search/utils/topic.py
+30
-25
No files found.
search/utils/topic.py
View file @
394e5924
...
...
@@ -561,6 +561,9 @@ class TopicUtils(object):
for
k
,
v
in
filters
.
items
():
if
not
v
:
continue
if
k
in
[
"create_time_gte"
,
"create_time_lte"
]:
if
k
==
"create_time_gte"
:
...
...
@@ -620,30 +623,31 @@ class TopicUtils(object):
})
elif
isinstance
(
sorts_by
,
list
):
if
sorts_by
==
TOPIC_SEARCH_SORT
.
ID_ASC
:
sort_rule
.
append
({
"id"
:{
"order"
:
"asc"
},
})
elif
sorts_by
==
TOPIC_SEARCH_SORT
.
ID_DESC
:
sort_rule
.
append
({
"id"
:{
"order"
:
"desc"
},
})
elif
sorts_by
==
TOPIC_SEARCH_SORT
.
SCORE_AEC
:
sort_rule
.
append
({
"sort_score"
:{
"order"
:
"asc"
},
})
elif
sorts_by
==
TOPIC_SEARCH_SORT
.
SCORE_DESC
:
sort_rule
.
append
({
"sort_score"
:{
"order"
:
"desc"
},
})
for
sort_by
in
sorts_by
:
if
sort_by
==
TOPIC_SEARCH_SORT
.
ID_AEC
:
sort_rule
.
append
({
"id"
:{
"order"
:
"asc"
},
})
elif
sort_by
==
TOPIC_SEARCH_SORT
.
ID_DESC
:
sort_rule
.
append
({
"id"
:{
"order"
:
"desc"
},
})
elif
sort_by
==
TOPIC_SEARCH_SORT
.
SCORE_AEC
:
sort_rule
.
append
({
"sort_score"
:{
"order"
:
"asc"
},
})
elif
sort_by
==
TOPIC_SEARCH_SORT
.
SCORE_DESC
:
sort_rule
.
append
({
"sort_score"
:{
"order"
:
"desc"
},
})
return
sort_rule
...
...
@@ -662,7 +666,8 @@ class TopicUtils(object):
if
sorts_by
:
sorts
=
cls
.
process_sort
(
sorts_by
)
q
[
"sort"
]
=
sorts
if
sorts
:
q
[
"sort"
]
=
sorts
try
:
result_dict
=
ESPerform
.
get_search_results
(
...
...
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