Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
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
宋柯
meta_base_code
Commits
f2dfdc31
Commit
f2dfdc31
authored
Nov 27, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
94934866
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
daily_search_word_count_last_two_year.py
task/daily_search_word_count_last_two_year.py
+9
-8
No files found.
task/daily_search_word_count_last_two_year.py
View file @
f2dfdc31
...
...
@@ -179,7 +179,8 @@ for t in range(1, task_days):
sql_search_ctr
=
r"""
SELECT query,
all_search_uv as all_search_uv, --全部搜索uv
all_search_pv as all_search_pv --全部搜索pv
all_search_pv as all_search_pv, --全部搜索pv
case when query in (select * from keywords_table) 0 else 1 end is_delete
FROM (
--搜索pvuv
SELECT query
...
...
@@ -198,7 +199,7 @@ for t in range(1, task_days):
AND partition_date < '{end_date}'
AND ((action = 'do_search' AND params['input_type'] <> 'everyone_watch') or
action = 'search_result_click_search')
AND params['query'] in (select * from keywords_table)
UNION all
SELECT cl_id,
...
...
@@ -216,7 +217,7 @@ for t in range(1, task_days):
and params['tab'] = '精选'
and page_name = 'home'
AND params['query'] not in ('AI测颜值', 'AI测肤质') --这两个词不跳转搜索结果页
AND params['query'] in (select * from keywords_table)
union all
SELECT cl_id,
...
...
@@ -231,7 +232,7 @@ for t in range(1, task_days):
AND partition_date < '{end_date}'
AND action = 'on_click_card'
AND params['page_name'] = 'search_home'
AND params['query'] in (select * from keywords_table)
union all
SELECT cl_id,
...
...
@@ -250,7 +251,7 @@ for t in range(1, task_days):
AND params['card_type'] = 'search_word'
AND params['card_name'] not in ('AI测颜值', 'AI测肤质') --这两个词不跳转搜索结果页
--AND page_name='home' android的page_name为空
AND params['card_name'] in (select * from keywords_table)
union all
SELECT cl_id,
...
...
@@ -267,7 +268,7 @@ for t in range(1, task_days):
AND params['page_name'] = 'welfare_home'
AND params['card_type'] = 'search_word'
AND params['in_page_pos'] = '大家都在搜'
AND params['card_name'] in (select * from keywords_table)
union all
SELECT cl_id,
...
...
@@ -282,7 +283,6 @@ for t in range(1, task_days):
AND partition_date < '{end_date}'
AND action = 'on_click_card'
AND params['card_type'] = 'highlight_word'
AND params['card_name'] in (select * from keywords_table)
) click
GROUP BY query
)
...
...
@@ -304,8 +304,9 @@ for t in range(1, task_days):
uv
=
name
.
all_search_uv
is_tag
=
tag_dict
.
get
(
keywords
,
0
)
servise_num
=
from_es_get_service_num
(
keywords
)
is_delete
=
name
.
is_delete
# pid = hashlib.md5((today_str + keywords).encode("utf8")).hexdigest()
tag_names_list_week
.
append
((
key_count
,
keywords
,
today_str
,
0
,
servise_num
,
pv
,
is_tag
))
tag_names_list_week
.
append
((
key_count
,
keywords
,
today_str
,
is_delete
,
servise_num
,
pv
,
is_tag
))
db
=
pymysql
.
connect
(
host
=
'172.16.30.136'
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
...
...
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