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
742bdca7
Commit
742bdca7
authored
Dec 12, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
a0695fe5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
topic.py
search/utils/topic.py
+1
-1
topic.py
search/views/topic.py
+2
-2
No files found.
search/utils/topic.py
View file @
742bdca7
...
@@ -204,7 +204,7 @@ class TopicUtils(object):
...
@@ -204,7 +204,7 @@ class TopicUtils(object):
'fields'
:
query_fields
,
'fields'
:
query_fields
,
}
}
query_function_score
[
"query"
][
"bool"
][
"should"
]
.
append
({
'multi_match'
:
multi_match
})
query_function_score
[
"query"
][
"bool"
][
"should"
]
.
append
({
'multi_match'
:
multi_match
})
query_function_score
[
"minimum_should_match"
]
=
1
query_function_score
[
"
query"
][
"bool"
][
"
minimum_should_match"
]
=
1
q
[
"query"
][
"function_score"
]
=
query_function_score
q
[
"query"
][
"function_score"
]
=
query_function_score
q
[
"_source"
]
=
{
q
[
"_source"
]
=
{
...
...
search/views/topic.py
View file @
742bdca7
...
@@ -27,7 +27,7 @@ def home_recommend(session_id="",user_id=-1,offset=0,size=10):
...
@@ -27,7 +27,7 @@ def home_recommend(session_id="",user_id=-1,offset=0,size=10):
session_id
=
""
session_id
=
""
redis_key
=
"physical:home_recommend"
+
":user_id:"
+
str
(
user_id
)
+
":session_id:"
+
session_id
redis_key
=
"physical:home_recommend"
+
":user_id:"
+
str
(
user_id
)
+
":session_id:"
+
session_id
redis_val_dict
=
redis_client
.
hgetall
(
redis_key
)
redis_val_dict
=
redis_client
.
hgetall
(
redis_key
)
last_offset_num
=
redis_val_dict
[
"last_offset_num"
]
if
"last_offset_num"
in
redis_val_dict
else
-
1
000
last_offset_num
=
redis_val_dict
[
"last_offset_num"
]
if
"last_offset_num"
in
redis_val_dict
else
-
1
recommend_topic_ids
=
[]
recommend_topic_ids
=
[]
...
@@ -91,7 +91,7 @@ def home_query(session_id="",user_id=-1,query="",offset=0,size=10):
...
@@ -91,7 +91,7 @@ def home_query(session_id="",user_id=-1,query="",offset=0,size=10):
session_id
=
""
session_id
=
""
redis_key
=
"physical:home_query"
+
":user_id:"
+
str
(
user_id
)
+
":session_id:"
+
session_id
redis_key
=
"physical:home_query"
+
":user_id:"
+
str
(
user_id
)
+
":session_id:"
+
session_id
redis_val_dict
=
redis_client
.
hgetall
(
redis_key
)
redis_val_dict
=
redis_client
.
hgetall
(
redis_key
)
last_offset_num
=
redis_val_dict
[
"last_offset_num"
]
if
"last_offset_num"
in
redis_val_dict
else
-
1
000
last_offset_num
=
redis_val_dict
[
"last_offset_num"
]
if
"last_offset_num"
in
redis_val_dict
else
-
1
recommend_topic_ids
=
[]
recommend_topic_ids
=
[]
...
...
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