diff --git a/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/integ_test/integ_test/common_operations.py b/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/integ_test/integ_test/common_operations.py index 0439dec31..0aee8e796 100644 --- a/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/integ_test/integ_test/common_operations.py +++ b/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/integ_test/integ_test/common_operations.py @@ -124,10 +124,15 @@ def get_all_index_details(cluster: Cluster, index_prefix_ignore_list=None, **kwa all_index_details = execute_api_call(cluster=cluster, path="/_cat/indices?format=json", **kwargs).json() index_dict = {} for index_details in all_index_details: + # While cat/indices returns a doc count metric, the underlying implementation bleeds through details, only + # capture the index name and make a separate api call for the doc count index_name = index_details['index'] valid_index = not index_matches_ignored_index(index_name, index_prefix_ignore_list=index_prefix_ignore_list) if index_prefix_ignore_list is None or valid_index: + # "To get an accurate count of Elasticsearch documents, use the cat count or count APIs." + # See https://www.elastic.co/guide/en/elasticsearch/reference/7.10/cat-indices.html + count_response = execute_api_call(cluster=cluster, path=f"/{index_name}/_count?format=json", **kwargs) index_dict[index_name] = count_response.json() return index_dict