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
64b074e2
Commit
64b074e2
authored
Apr 26, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modifuy
parent
abe09afb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
16 deletions
+8
-16
topic.py
search/utils/topic.py
+0
-8
topic.py
trans2es/models/topic.py
+8
-8
No files found.
search/utils/topic.py
View file @
64b074e2
...
@@ -182,14 +182,6 @@ class TopicUtils(object):
...
@@ -182,14 +182,6 @@ class TopicUtils(object):
}
}
},
},
"weight"
:
1000
"weight"
:
1000
},
{
"filter"
:
{
"term"
:
{
"is_excellent"
:
1
}
},
"weight"
:
500
}
}
]
]
...
...
trans2es/models/topic.py
View file @
64b074e2
...
@@ -209,7 +209,7 @@ class Topic(models.Model):
...
@@ -209,7 +209,7 @@ class Topic(models.Model):
user_query_results
=
UserExtra
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
user_id
=
self
.
user_id
)
user_query_results
=
UserExtra
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
user_id
=
self
.
user_id
)
if
user_query_results
.
count
()
>
0
:
if
user_query_results
.
count
()
>
0
:
if
user_query_results
[
0
]
.
is_recommend
:
if
user_query_results
[
0
]
.
is_recommend
:
offline_score
+=
2.0
offline_score
+=
2.0
*
10
elif
user_query_results
[
0
]
.
is_shadow
:
elif
user_query_results
[
0
]
.
is_shadow
:
user_is_shadow
=
True
user_is_shadow
=
True
...
@@ -219,18 +219,18 @@ class Topic(models.Model):
...
@@ -219,18 +219,18 @@ class Topic(models.Model):
# 帖子等级
# 帖子等级
if
self
.
content_level
==
'5'
:
if
self
.
content_level
==
'5'
:
offline_score
+=
6.0
offline_score
+=
100.0
*
3
elif
self
.
content_level
==
'4'
:
elif
self
.
content_level
==
'4'
:
offline_score
+=
5.0
offline_score
+=
60.0
*
3
elif
self
.
content_level
==
'6'
:
elif
self
.
content_level
==
'6'
:
offline_score
+=
400.0
offline_score
+=
200.0
*
3
is_excellent
=
self
.
judge_if_excellent_topic
(
self
.
id
)
#
is_excellent = self.judge_if_excellent_topic(self.id)
if
is_excellent
:
#
if is_excellent:
offline_score
+=
200.0
#
offline_score += 200.0
if
self
.
language_type
==
1
:
if
self
.
language_type
==
1
:
offline_score
+=
10
0.0
offline_score
+=
6
0.0
# exposure_count = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=1).count()
# exposure_count = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=1).count()
# click_count = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=2).count()
# click_count = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=2).count()
# uv_num = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=3).count()
# uv_num = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=3).count()
...
...
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