Commit 1601b62b authored by litaolemo's avatar litaolemo

update

parent 452fcb38
...@@ -321,20 +321,24 @@ def get_es_article_num(tag_dict): ...@@ -321,20 +321,24 @@ def get_es_article_num(tag_dict):
"gte": 30 "gte": 30
} }
} }
}], }]
} }
}, }
} }
body["query"]["bool"]["must"].append({"term": {tag_type: tag_name}}) body["query"]["bool"]["must"].append({"term": {tag_type: tag_name}})
results = es.search( try:
index='gm-dbmw-answer-read', results = es.search(
doc_type='answer', index='gm-dbmw-answer-read',
timeout='10s', doc_type='answer',
size=0, timeout='10s',
body=body size=0,
) body=body
answer_content_num = results["hits"]["total"] )
answer_content_num = results["hits"]["total"]
except:
print("answer has no %s" %tag_type)
answer_content_num = 0
body = { body = {
"query": { "query": {
......
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