Commit 209f1545 authored by litaolemo's avatar litaolemo

update

parent 39bebac4
...@@ -28,18 +28,7 @@ import datetime ...@@ -28,18 +28,7 @@ import datetime
# 'port': 9200, # 'port': 9200,
# }]) # }])
es = Elasticsearch([
{
'host': '172.16.31.6',
'port': 9200,
}, {
'host': '172.16.31.16',
'port': 9200,
}, {
'host': '172.16.31.10',
'port': 9200,
}
])
def get_all_tag(): def get_all_tag():
...@@ -58,6 +47,19 @@ def get_all_tag(): ...@@ -58,6 +47,19 @@ def get_all_tag():
def from_es_get_service_num(query): def from_es_get_service_num(query):
es = Elasticsearch([
{
'host': '172.16.31.6',
'port': 9200,
}, {
'host': '172.16.31.16',
'port': 9200,
}, {
'host': '172.16.31.10',
'port': 9200,
}
])
q = { q = {
"query": { "query": {
"bool": { "bool": {
...@@ -306,8 +308,12 @@ for t in range(1, task_days): ...@@ -306,8 +308,12 @@ for t in range(1, task_days):
pv = name.all_search_pv pv = name.all_search_pv
uv = name.all_search_uv uv = name.all_search_uv
is_tag = tag_dict.get(keywords, 0) is_tag = tag_dict.get(keywords, 0)
servise_num = from_es_get_service_num(keywords)
is_delete = 0 if keyword_dict.get(keywords) else 1 is_delete = 0 if keyword_dict.get(keywords) else 1
if not is_delete:
servise_num = from_es_get_service_num(keywords)
else:
servise_num = 0
# pid = hashlib.md5((today_str + keywords).encode("utf8")).hexdigest() # pid = hashlib.md5((today_str + keywords).encode("utf8")).hexdigest()
tag_names_list_week.append((key_count, keywords, today_str, is_delete, servise_num, pv, is_tag)) tag_names_list_week.append((key_count, keywords, today_str, is_delete, servise_num, pv, is_tag))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment