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
32b35173
Commit
32b35173
authored
Apr 22, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of git.wanmeizhensuo.com:alpha/physical into test
parents
b03ad5b5
f78c3de4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
29 deletions
+23
-29
Project.xml
.idea/codeStyles/Project.xml
+0
-25
topic.py
search/utils/topic.py
+20
-1
topic.py
search/views/topic.py
+3
-3
No files found.
.idea/codeStyles/Project.xml
View file @
32b35173
...
...
@@ -24,29 +24,5 @@
<option
name=
"ITERATION_ELEMENTS_WRAPPING"
value=
"chop_down_if_not_single"
/>
</formatting-settings>
</DBN-SQL>
<DBN-PSQL>
<case-options
enabled=
"false"
>
<option
name=
"KEYWORD_CASE"
value=
"lower"
/>
<option
name=
"FUNCTION_CASE"
value=
"lower"
/>
<option
name=
"PARAMETER_CASE"
value=
"lower"
/>
<option
name=
"DATATYPE_CASE"
value=
"lower"
/>
<option
name=
"OBJECT_CASE"
value=
"preserve"
/>
</case-options>
<formatting-settings
enabled=
"false"
/>
</DBN-PSQL>
<DBN-SQL>
<case-options
enabled=
"false"
>
<option
name=
"KEYWORD_CASE"
value=
"lower"
/>
<option
name=
"FUNCTION_CASE"
value=
"lower"
/>
<option
name=
"PARAMETER_CASE"
value=
"lower"
/>
<option
name=
"DATATYPE_CASE"
value=
"lower"
/>
<option
name=
"OBJECT_CASE"
value=
"preserve"
/>
</case-options>
<formatting-settings
enabled=
"false"
>
<option
name=
"STATEMENT_SPACING"
value=
"one_line"
/>
<option
name=
"CLAUSE_CHOP_DOWN"
value=
"chop_down_if_statement_long"
/>
<option
name=
"ITERATION_ELEMENTS_WRAPPING"
value=
"chop_down_if_not_single"
/>
</formatting-settings>
</DBN-SQL>
</code_scheme>
</component>
\ No newline at end of file
search/utils/topic.py
View file @
32b35173
...
...
@@ -456,12 +456,28 @@ class TopicUtils(object):
}
}
]
if
len
(
topic_tag_list
)
>
0
:
functions_list
.
append
(
{
"filter"
:
{
"bool"
:
{
"should"
:
{
"terms"
:
{
"tag_list"
:
topic_tag_list
}}}},
"weight"
:
5000
}
)
if
topic_user_id
!=
-
1
:
functions_list
.
append
(
{
"filter"
:
{
"bool"
:
{
"should"
:
{
"term"
:
{
"user_id"
:
topic_user_id
}}}},
"weight"
:
5000
}
)
if
len
(
topic_tag_list
)
!=
0
or
user_id
!=
-
1
:
query_function_score
=
{
"query"
:
{
"bool"
:
{
"must"
:
[
{
"range"
:
{
"content_level"
:
{
"gte"
:
3
,
"lte"
:
6
}}},
{
"range"
:
{
"content_level"
:
{
"gte"
:
5
,
"lte"
:
6
}}},
{
"term"
:
{
"is_online"
:
True
}},
{
"term"
:
{
"is_deleted"
:
False
}}
],
...
...
@@ -510,6 +526,9 @@ class TopicUtils(object):
}
}
q
[
"query"
][
"function_score"
]
=
query_function_score
q
[
"collapse"
]
=
{
"field"
:
"user_id"
}
q
[
"_source"
]
=
{
"includes"
:
[
"id"
,
"pictorial_id"
,
"user_id"
,
"_score"
]
}
...
...
search/views/topic.py
View file @
32b35173
...
...
@@ -265,11 +265,11 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic
try
:
if
not
isinstance
(
user_id
,
int
):
user_id
=
-
1
if
user_id
>
0
:
if
user_id
>
0
:
redis_key
=
"physical:topic_detail_recommend"
+
":user_id:"
+
str
(
user_id
)
+
"topic_id:"
+
str
(
topic_id
)
else
:
else
:
redis_key
=
"physical:topic_detail_recommend"
+
":device_id:"
+
device_id
+
"topic_id:"
+
str
(
topic_id
)
if
offset
==
0
:
if
int
(
offset
)
==
0
:
have_read_topic_list
=
list
()
# redis_dict = {
# "have_read_topic_id": json.dumps(have_read_topic_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