Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mentha
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
1
Merge Requests
1
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
rank
mentha
Commits
3eebb97c
Commit
3eebb97c
authored
Nov 18, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add_hauxiang' into 'master'
Add hauxiang See merge request
!4
parents
fe7ae4f3
07550381
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
transfer.py
data_sync/answer/transfer.py
+3
-2
toutiao.py
qa/models/toutiao.py
+1
-1
No files found.
data_sync/answer/transfer.py
View file @
3eebb97c
...
...
@@ -14,6 +14,7 @@ import time
import
datetime
from
django.conf
import
settings
import
redis
rpc
=
get_rpc_invoker
()
...
...
@@ -83,7 +84,7 @@ def get_answers(pks):
item
[
"content_star_first_keyword"
]
=
get_content_star_first_keyword
(
id
=
answer
.
id
,
content_type
=
"answer"
)
# item["title_keyword"] = get_content_title_keywords(id=answer.id, content_type="answer")
# item["has_service"] = has_service(tag_ids, content_keyword)
item
[
"has_service"
]
=
False
item
[
"has_service"
]
=
False
item
[
'operators_add_tags'
]
=
get_tag_v3_operators_tags
(
content_id
=
answer
.
id
,
content_type
=
"answer"
)
item
[
'anecdote_tags'
]
=
get_tag_v3_anecdote_tags
(
content_id
=
answer
.
id
,
content_type
=
"answer"
)
item
[
'anecdote_tag_ids'
]
=
get_tag_v3_anecdote_tag_ids
(
content_id
=
answer
.
id
,
content_type
=
"answer"
)
...
...
@@ -171,7 +172,7 @@ def get_answers(pks):
item
[
"is_need_guarantee"
]
=
True
# else: # 7天以上强制不保量
# item["is_need_guarantee"] = False
item
[
"has_video"
]
=
Answer
.
has_video
(
answer
)
item
[
"has_video"
]
=
Answer
.
has_video
(
answer
)
data
.
append
(
item
)
except
(
Answer
.
DoesNotExist
,
Question
.
DoesNotExist
):
pass
...
...
qa/models/toutiao.py
View file @
3eebb97c
...
...
@@ -111,7 +111,7 @@ def has_service(tag_list, content_keyword):
{
"terms"
:
{
"closure_tags"
:
content_keyword
}}],
"minimum_should_match"
:
1
}}
res
=
es_query
(
"service"
,
q
,
0
,
1
)
res
=
es_query
(
doc
=
"service"
,
body
=
q
,
offset
=
0
,
size
=
1
)
if
res
:
if
res
[
'hits'
][
'total'
]
>
0
:
return
True
...
...
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