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
7fd4ba3e
Commit
7fd4ba3e
authored
Aug 30, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
0b6d21f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
topic.py
search/utils/topic.py
+0
-2
tag.py
search/views/tag.py
+9
-3
No files found.
search/utils/topic.py
View file @
7fd4ba3e
...
...
@@ -4,7 +4,6 @@
import
logging
import
traceback
import
json
from
alpha_types.venus
import
TOPIC_SEARCH_SORT
from
search.views.tag
import
get_same_tagset_ids
from
libs.es
import
ESPerform
...
...
@@ -13,7 +12,6 @@ from search.utils.common import *
from
trans2es.models.pictorial
import
PictorialTopics
from
libs.cache
import
redis_client
class
TopicUtils
(
object
):
@classmethod
...
...
search/views/tag.py
View file @
7fd4ba3e
...
...
@@ -6,7 +6,6 @@ from gm_rpcd.all import bind
import
logging
import
traceback
import
json
from
search.utils.topic
import
TopicUtils
from
libs.es
import
ESPerform
from
libs.cache
import
redis_client
from
search.utils.common
import
*
...
...
@@ -16,6 +15,7 @@ from trans2es.models.tag import CommunityTagSetRelation
from
django.conf
import
settings
from
libs.error
import
logging_exception
def
get_highlight
(
fields
=
[]):
field_highlight
=
{
'fields'
:
{
k
:
{}
for
k
in
fields
},
...
...
@@ -236,10 +236,16 @@ def get_same_tagset_ids(tag_list):
:return:
"""
try
:
all_tag
=
list
()
if
isinstance
(
tag_list
,
int
):
all_tag
.
append
(
list
)
else
:
all_tag
=
tag_list
tag_set_list_id
=
list
(
CommunityTagSetRelation
.
objects
.
filter
(
tag_id__in
=
tag_list
,
is_deleted
=
False
)
.
values_list
(
"tag_set_id"
,
flat
=
True
))
CommunityTagSetRelation
.
objects
.
filter
(
tag_id__in
=
all_tag
,
is_deleted
=
False
)
.
values_list
(
"tag_set_id"
,
flat
=
True
))
logging
.
info
(
"get tag_set_list_id:
%
s"
%
tag_set_list_id
)
tag_ids
=
list
(
CommunityTagSetRelation
.
objects
.
filter
(
tag_set_id__in
=
tag_set_list_id
,
is_deleted
=
False
)
.
values_list
(
...
...
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