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
4dab11a7
Commit
4dab11a7
authored
Sep 04, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'recommend_pictorial' into 'master'
Recommend pictorial See merge request
alpha/physical!461
parents
26a03a72
1e0c1a66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
group.py
search/views/group.py
+29
-9
No files found.
search/views/group.py
View file @
4dab11a7
...
...
@@ -139,7 +139,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
}
}
q
[
"_source"
]
=
{
"includes"
:
[
"id"
,
"pictorial_id"
,
"tag_list"
]
"includes"
:
[
"id"
,
"pictorial_id"
,
"
edit_
tag_list"
]
}
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"topic"
,
q
,
offset
,
size
)
pict_pictorial_ids_list
=
[]
...
...
@@ -148,7 +148,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
if
len
(
result_dict
[
"hits"
])
>
0
:
for
item
in
result_dict
[
"hits"
]:
pict_pictorial_ids_list
=
item
[
"_source"
][
"pictorial_id"
]
topic_tag_list
=
item
[
"_source"
][
"tag_list"
]
topic_tag_list
=
item
[
"_source"
][
"
edit_
tag_list"
]
##拿到这些标签的同义词
...
...
@@ -178,6 +178,11 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
"is_deleted"
:
False
}
},
{
"term"
:
{
"is_cover"
:
True
}
}
]
}
...
...
@@ -185,12 +190,18 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
q
[
"_source"
]
=
{
"includes"
:
[
"id"
,
"update_time"
]
}
q
[
"sort"
]
=
{
'update_time'
:
{
q
[
"sort"
]
=
[
{
"real_user_activate_time"
:
{
"order"
:
"desc"
}
},
{
'update_time'
:
{
'order'
:
'desc'
}
}
}
]
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"pictorial"
,
q
,
offset
,
size
)
if
len
(
result_dict
[
"hits"
])
>
0
:
for
item
in
result_dict
[
"hits"
]:
...
...
@@ -208,7 +219,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
"bool"
:
{
"must"
:
[{
"terms"
:
{
"tag_id"
:
all_tag
"
edit_
tag_id"
:
all_tag
}},
{
"term"
:
{
"is_online"
:
True
...
...
@@ -224,6 +235,10 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
}
}
},
{
"term"
:
{
"is_cover"
:
True
}
}]
}
}
...
...
@@ -233,7 +248,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
"constant_score"
:
{
"filter"
:
{
"terms"
:
{
"tag_id"
:
topic_tag_list
"
edit_
tag_id"
:
topic_tag_list
}
}
}
...
...
@@ -251,13 +266,18 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
}
}
q
[
"_source"
]
=
{
"includes"
:
[
"id"
,
"tag_id"
]}
"includes"
:
[
"id"
,
"
edit_
tag_id"
]}
q
[
"sort"
]
=
[
{
"_score"
:
{
"order"
:
"desc"
}
},
{
"real_user_activate_time"
:
{
"order"
:
"desc"
}
},
{
'update_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