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
397a968c
Commit
397a968c
authored
May 14, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Plain Diff
update
parents
2c519908
42514adb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
es.py
libs/es.py
+17
-17
topic.py
search/utils/topic.py
+0
-0
topic.py
search/views/topic.py
+0
-0
No files found.
libs/es.py
View file @
397a968c
...
...
@@ -378,27 +378,27 @@ class ESPerform(object):
"weight"
:
1
}
)
functions_list
+=
[
{
"filter"
:
{
"term"
:
{
"content_level"
:
6
}},
"weight"
:
6000
},
{
"filter"
:
{
"term"
:
{
"content_level"
:
5
}},
"weight"
:
5000
},
{
"filter"
:
{
"term"
:
{
"content_level"
:
4
}},
"weight"
:
4000
}
]
#
functions_list += [
#
{
#
"filter": {"term": {"content_level": 6}},
#
"weight": 6000
#
},
#
{
#
"filter": {"term": {"content_level": 5}},
#
"weight": 5000
#
},
#
{
#
"filter": {"term": {"content_level": 4}},
#
"weight": 4000
#
}
#
]
q
=
{
"query"
:
{
"function_score"
:
{
"query"
:
{
"bool"
:
{
"must"
:
[
{
"
range"
:
{
"content_level"
:
{
"gte"
:
4
,
"lte"
:
6
}
}},
{
"
term"
:
{
"content_level"
:
6
}},
{
"term"
:
{
"is_online"
:
True
}},
{
"term"
:
{
"is_deleted"
:
False
}},
{
"terms"
:
{
"tag_list"
:
tag_id
}}
...
...
@@ -425,8 +425,8 @@ class ESPerform(object):
"id"
:
have_read_topic_id_list
}
}
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"topic"
,
query_body
=
q
,
offset
=
0
,
size
=
size
,
routing
=
"
4,5,
6"
)
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"topic
-high-star
"
,
query_body
=
q
,
offset
=
0
,
size
=
size
,
routing
=
"6"
)
topic_id_list
=
[
item
[
"_source"
][
"id"
]
for
item
in
result_dict
[
"hits"
]]
# logging.info("topic_id_list:%s" % str(topic_id_list))
...
...
search/utils/topic.py
View file @
397a968c
This diff is collapsed.
Click to expand it.
search/views/topic.py
View file @
397a968c
This diff is collapsed.
Click to expand it.
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