We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38e3146 commit 75beab0Copy full SHA for 75beab0
docker/solr_api.py
@@ -27,9 +27,14 @@ def __init__(self, url):
27
def get_num_docs(self, collection_name):
28
final_url = self.QUERY_DATA.format(self.url, collection_name)
29
res = requests.get(final_url)
30
- dic = res.json()
31
- num_docs = dic["response"]["numFound"]
32
- return num_docs
+ try:
+ dic = res.json()
+ num_docs = dic["response"]["numFound"]
33
+ return num_docs
34
+ except Exception as e:
35
+ print(F"Erro no get_num_docs: {e}")
36
+ print(res.content)
37
+ return 0
38
39
def list_collections(self):
40
req_url = self.LIST_COLLECTIONS.format(self.url)
0 commit comments