@Shree Hima Bindu Maganti thanks again for another response. That didn't quite work, but it got me in the right direction. Below is the code block I used to get the unique count of the values in metadata_storage_path.
Hopefully this can help others. The count of unique source documents in the Azure AI Search UI would be much more valuable than the count of document chunks that is currently there.
# Write the response JSON to a file
with open('response.json', 'w') as json_file:
json.dump(response_json, json_file, indent=4)
# Extract and count distinct values in metadata_storage_path
if '@search.facets' in response_json and 'metadata_storage_path' in response_json['@search.facets']:
distinct_values = set()
for item in response_json['@search.facets']['metadata_storage_path']:
distinct_values.add(item['value'])
print("Distinct metadata_storage_path count:", len(distinct_values))
else:
print("metadata_storage_path facet not found in the response.")