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
af213e1d
Commit
af213e1d
authored
Jun 19, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改topic为topic-test
parent
98f7dcd9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
topic.py
search/utils/topic.py
+6
-6
topic.py
search/views/topic.py
+5
-5
No files found.
search/utils/topic.py
View file @
af213e1d
...
...
@@ -107,7 +107,7 @@ class TopicUtils(object):
"includes"
:
[
"id"
,
"pictorial_id"
,
"offline_score"
,
"user_id"
,
"edit_tag_list"
]
}
}
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"topic"
,
query_body
=
q
,
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"topic
-test
"
,
query_body
=
q
,
offset
=
offset
,
size
=
size
)
topic_id_dict
=
dict
()
...
...
@@ -126,7 +126,7 @@ class TopicUtils(object):
def
get_recommend_topic_ids
(
cls
,
user_id
,
tag_id
,
offset
,
size
,
single_size
,
query
=
None
,
query_type
=
TopicPageType
.
HOME_RECOMMEND
,
filter_topic_id_list
=
[],
test_score
=
False
,
must_topic_id_list
=
[],
recommend_tag_list
=
[],
user_similar_score_list
=
[],
index_type
=
"topic"
,
routing
=
None
,
attention_tag_list
=
[],
user_similar_score_list
=
[],
index_type
=
"topic
-test
"
,
routing
=
None
,
attention_tag_list
=
[],
linucb_user_id_list
=
[],
disable_collpase
=
False
):
"""
:remark:获取首页推荐帖子列表
...
...
@@ -420,7 +420,7 @@ class TopicUtils(object):
@classmethod
def
get_topic_detail_recommend_list
(
cls
,
user_id
,
topic_id
,
topic_tag_list
,
topic_pictorial_id
,
topic_user_id
,
filter_topic_user_id
,
have_read_topic_list
,
offset
,
size
,
es_cli_obj
=
None
,
index_type
=
"topic"
,
routing
=
None
):
index_type
=
"topic
-test
"
,
routing
=
None
):
"""
:remark 帖子详情页推荐列表,缺少按时间衰减
:param user_id:
...
...
@@ -506,7 +506,7 @@ class TopicUtils(object):
@classmethod
def
top_get_topic_detail_recommend_list
(
cls
,
user_id
,
topic_id
,
have_read_topic_list
,
size
,
es_cli_obj
=
None
,
index_type
=
"topic"
,
routing
=
None
,
collection_topic_tag_list
=
[],
index_type
=
"topic
-test
"
,
routing
=
None
,
collection_topic_tag_list
=
[],
topic_tag_list
=
[],
topic_user_id
=-
1
):
"""
...
...
@@ -652,7 +652,7 @@ class TopicUtils(object):
"includes"
:
[
TopicDocumentField
.
TAG_LIST
]
}
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
sub_index_name
=
"topic"
,
query_body
=
q
,
size
=
1
)
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
sub_index_name
=
"topic
-test
"
,
query_body
=
q
,
size
=
1
)
tag_id_list
=
[]
if
len
(
result_dict
[
"hits"
])
>
0
:
...
...
@@ -748,7 +748,7 @@ class TopicUtils(object):
}
]
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"topic"
,
query_body
=
q
,
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"topic
-test
"
,
query_body
=
q
,
offset
=
offset
,
size
=
size
)
return
result_dict
[
"hits"
]
...
...
search/views/topic.py
View file @
af213e1d
...
...
@@ -33,7 +33,7 @@ def get_discover_page_topic_ids(user_id, device_id, size, query_type=TopicPageTy
single_size
=
size
,
query_type
=
query_type
,
filter_topic_id_list
=
have_read_topic_id_list
,
index_type
=
"topic"
,
routing
=
"4,5,6"
)
index_type
=
"topic
-test
"
,
routing
=
"4,5,6"
)
have_read_topic_id_list
.
extend
(
recommend_topic_ids
)
redis_dict
=
{
...
...
@@ -372,7 +372,7 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic
if
len
(
topic_tag_list
)
!=
0
:
topic_tag_result
=
TopicUtils
.
top_get_topic_detail_recommend_list
(
user_id
,
topic_id
,
have_read_topic_list
,
size
,
es_cli_obj
,
index_type
=
"topic"
,
routing
=
"3,4,5,6"
,
index_type
=
"topic
-test
"
,
routing
=
"3,4,5,6"
,
topic_tag_list
=
topic_tag_list
)
topic_tag_size
=
len
(
topic_tag_result
)
have_read_topic_list
.
extend
(
topic_tag_result
)
...
...
@@ -384,7 +384,7 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic
topic_user_result
=
TopicUtils
.
top_get_topic_detail_recommend_list
(
user_id
,
topic_id
,
have_read_topic_list
,
size
,
es_cli_obj
,
index_type
=
"topic"
,
index_type
=
"topic
-test
"
,
routing
=
"3,4,5,6"
,
topic_user_id
=
topic_user_id
)
...
...
@@ -395,7 +395,7 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic
result
=
TopicUtils
.
top_get_topic_detail_recommend_list
(
user_id
,
topic_id
,
have_read_topic_list
,
size
,
es_cli_obj
,
index_type
=
"topic"
,
routing
=
"4,5,6"
)
index_type
=
"topic
-test
"
,
routing
=
"4,5,6"
)
have_read_topic_list
.
extend
(
result
)
# have_read_topic_redis_data = redis_client.get(redis_key)
...
...
@@ -498,7 +498,7 @@ def query_topic_by_user_similarity(topic_similarity_score_dict, offset=0, size=1
must_topic_id_list
=
list
(
topic_similarity_score_dict
.
keys
())
topic_id_list
=
TopicUtils
.
get_recommend_topic_ids
(
tag_id
=
0
,
user_id
=-
1
,
offset
=
offset
,
size
=
size
,
single_size
=
size
,
must_topic_id_list
=
must_topic_id_list
,
index_type
=
"topic"
,
must_topic_id_list
=
must_topic_id_list
,
index_type
=
"topic
-test
"
,
routing
=
"4,5,6"
)
return
{
"recommend_topic_ids"
:
topic_id_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