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
230e12fb
Commit
230e12fb
authored
Jul 03, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
4a82d669
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
topic.py
search/utils/topic.py
+15
-4
group.py
search/views/group.py
+7
-2
No files found.
search/utils/topic.py
View file @
230e12fb
...
@@ -929,6 +929,7 @@ class TopicUtils(object):
...
@@ -929,6 +929,7 @@ class TopicUtils(object):
},
},
})
})
elif
sort_by
==
TOPIC_SEARCH_SORT
.
REAL_VOTE_AEC
:
elif
sort_by
==
TOPIC_SEARCH_SORT
.
REAL_VOTE_AEC
:
logging
.
info
(
"hhhhhhhhhhhhhhhhhhhhh"
)
sort_rule
.
append
({
sort_rule
.
append
({
"related_billboard.real_vote_cnt"
:
{
"related_billboard.real_vote_cnt"
:
{
"order"
:
"asc"
,
"order"
:
"asc"
,
...
@@ -943,11 +944,13 @@ class TopicUtils(object):
...
@@ -943,11 +944,13 @@ class TopicUtils(object):
},
},
})
})
elif
sort_by
==
TOPIC_SEARCH_SORT
.
REAL_VOTE_DESC
:
elif
sort_by
==
TOPIC_SEARCH_SORT
.
REAL_VOTE_DESC
:
logging
.
info
(
"hhhhhhhhhh3333hhhhhhhhhhh"
)
sort_rule
.
append
({
sort_rule
.
append
({
"related_billboard.real_vote_cnt"
:
{
"related_billboard.real_vote_cnt"
:
{
"order"
:
"desc"
,
"order"
:
"desc"
,
"nested_path"
:
"related_billboard"
,
"nested_path"
:
"related_billboard"
,
"missing"
:
"_last"
,
#
"missing": "_last",
"nested_filter"
:
{
"nested_filter"
:
{
"term"
:
{
"term"
:
{
"related_billboard.pictorial_id"
:
pictorial_id
"related_billboard.pictorial_id"
:
pictorial_id
...
@@ -957,11 +960,13 @@ class TopicUtils(object):
...
@@ -957,11 +960,13 @@ class TopicUtils(object):
},
},
})
})
elif
sort_by
==
TOPIC_SEARCH_SORT
.
VIRT_VOTE_AEC
:
elif
sort_by
==
TOPIC_SEARCH_SORT
.
VIRT_VOTE_AEC
:
logging
.
info
(
"hhhhhhhhhhghfhgdggerrhhhhhhhhhhh"
)
sort_rule
.
append
({
sort_rule
.
append
({
"related_billboard.virt_vote_cnt"
:
{
"related_billboard.virt_vote_cnt"
:
{
"order"
:
"asc"
,
"order"
:
"asc"
,
"nested_path"
:
"related_billboard"
,
"nested_path"
:
"related_billboard"
,
"missing"
:
"_last"
,
#
"missing": "_last",
"nested_filter"
:
{
"nested_filter"
:
{
"term"
:
{
"term"
:
{
"related_billboard.pictorial_id"
:
pictorial_id
"related_billboard.pictorial_id"
:
pictorial_id
...
@@ -970,11 +975,13 @@ class TopicUtils(object):
...
@@ -970,11 +975,13 @@ class TopicUtils(object):
},
},
})
})
elif
sort_by
==
TOPIC_SEARCH_SORT
.
VIRT_VOTE_DESC
:
elif
sort_by
==
TOPIC_SEARCH_SORT
.
VIRT_VOTE_DESC
:
logging
.
info
(
"hhhhhhhhhhhhheeeeeeehhhhhhhh"
)
sort_rule
.
append
({
sort_rule
.
append
({
"related_billboard.virt_vote_cnt"
:
{
"related_billboard.virt_vote_cnt"
:
{
"order"
:
"desc"
,
"order"
:
"desc"
,
"nested_path"
:
"related_billboard"
,
"nested_path"
:
"related_billboard"
,
"missing"
:
"_last"
,
#
"missing": "_last",
"nested_filter"
:
{
"nested_filter"
:
{
"term"
:
{
"term"
:
{
"related_billboard.pictorial_id"
:
pictorial_id
"related_billboard.pictorial_id"
:
pictorial_id
...
@@ -982,6 +989,8 @@ class TopicUtils(object):
...
@@ -982,6 +989,8 @@ class TopicUtils(object):
}
}
},
},
})
})
logging
.
info
(
"get picotirial:
%
s"
%
sort_rule
)
return
sort_rule
return
sort_rule
@classmethod
@classmethod
...
@@ -1040,13 +1049,15 @@ class TopicUtils(object):
...
@@ -1040,13 +1049,15 @@ class TopicUtils(object):
}
}
if
'pictorial_id'
in
filters
.
keys
():
if
'pictorial_id'
in
filters
.
keys
():
logging
.
info
(
"get picotirial:
%
s"
%
filters
[
"pictorial_id"
])
logging
.
info
(
"get picotirial:
%
s"
%
filters
[
"pictorial_id"
])
logging
.
info
(
"get picotirial:
%
s"
%
sorts_by
)
if
sorts_by
:
if
sorts_by
:
sorts
=
cls
.
process_sort
(
sorts_by
,
filters
[
"pictorial_id"
])
sorts
=
cls
.
process_sort
(
sorts_by
,
filters
[
"pictorial_id"
])
if
sorts
:
if
sorts
:
q
[
"sort"
]
=
sorts
q
[
"sort"
]
=
sorts
else
:
else
:
if
sorts_by
:
if
sorts_by
:
sorts
=
cls
.
process_sort
(
sorts_by
,
pictorial_id
=
None
)
sorts
=
cls
.
process_sort
(
sorts_by
,
pictorial_id
=
None
)
if
sorts
:
if
sorts
:
q
[
"sort"
]
=
sorts
q
[
"sort"
]
=
sorts
...
...
search/views/group.py
View file @
230e12fb
...
@@ -277,8 +277,13 @@ def pictorial_topic_sort(pictorial_id=-1, offset=0, size=10):
...
@@ -277,8 +277,13 @@ def pictorial_topic_sort(pictorial_id=-1, offset=0, size=10):
"sort"
:
[
"sort"
:
[
{
"related_billboard.total_vote_cnt"
:
{
{
"related_billboard.total_vote_cnt"
:
{
"order"
:
"desc"
,
"order"
:
"desc"
,
# "mode": "min",
"nested_path"
:
"related_billboard"
,
"nested_path"
:
"related_billboard"
"missing"
:
"_last"
,
"nested_filter"
:
{
"term"
:
{
"related_billboard.pictorial_id"
:
pictorial_id
}
}
}},
}},
{
"create_time"
:
{
"order"
:
"desc"
}}
{
"create_time"
:
{
"order"
:
"desc"
}}
]
]
...
...
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