Commit 97661730 authored by litaolemo's avatar litaolemo

update

parent 1601b62b
......@@ -353,6 +353,7 @@ def get_es_article_num(tag_dict):
}
body["query"]["bool"]["must"].append({"term": {tag_type: tag_name}})
# tractate
try:
results = es.search(
index='gm-dbmw-tractate-read',
doc_type='tractate',
......@@ -360,9 +361,10 @@ def get_es_article_num(tag_dict):
size=0,
body=body
)
tractate_content_num = results["hits"]["total"]
except:
tractate_content_num = 0
print("gm-dbmw-tractate-read has no %s" % tag_type)
body = {
"query": {
"bool": {
......@@ -395,6 +397,7 @@ def get_es_article_num(tag_dict):
}
body["query"]["bool"]["must"].append({"term": {tag_type: tag_name}})
###diary 日记
try:
results = es.search(
index='gm-dbmw-diary-read',
doc_type='diary',
......@@ -403,6 +406,9 @@ def get_es_article_num(tag_dict):
body=body
)
diary_content_num = results["hits"]["total"]
except:
diary_content_num = 0
print("gm-dbmw-diary-read has no %s" % tag_type)
total_num = answer_content_num + tractate_content_num + diary_content_num
data_dic = {tag_name: (answer_content_num, tractate_content_num, diary_content_num, total_num)}
print(data_dic)
......
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