Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MKM-data
TEXTA Toolkit
Commits
1fd931d3
Commit
1fd931d3
authored
Jul 25, 2019
by
mkollo
Browse files
Changed previous fix to avoid complications from cluster errors.
parent
4e9782a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/es_manager.py
View file @
1fd931d3
...
...
@@ -684,11 +684,13 @@ class ES_Manager:
return
response
[
'count'
]
@
staticmethod
def
single_index_count
(
index_name
:
str
)
->
int
:
try
:
count
=
Search
(
using
=
Elasticsearch
(
es_url
),
index
=
index_name
).
count
()
def
single_index_count
(
index_name
:
str
):
es
=
Elasticsearch
(
es_url
)
status
=
es
.
cat
.
indices
(
index
=
index_name
,
h
=
"status"
).
strip
()
if
status
==
"open"
:
count
=
Search
(
using
=
es
,
index
=
index_name
).
count
()
return
count
e
xcept
elasticsearch
.
RequestError
as
e
:
e
ls
e
:
return
None
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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