Get filter attribute statistics for corpus metadata
GET/v2/corpora/:corpus_key/filter_attribute_stats
Retrieve statistics and value distributions for filter attributes in a corpus. This endpoint provides insights into the metadata structure and content distribution, enabling users to understand available filter values and build effective metadata queries.
This endpoint analyzes document and part metadata fields defined as filter attributes and returns:
- Value distributions: Top occurring values with their counts
- Statistics: Min, max, average, and sum for numeric fields
By default, statistics are computed across all filter attributes at both document and part levels. You can optionally:
- Request statistics for specific fields only
- Apply metadata filters to analyze a subset of the corpus
- Limit the number of distinct values returned per field
Performance and Caching: Results may be cached for improved performance, with cache duration varying by corpus size. Cached results can take up to 1 hour to refresh for large corpora. Smaller corpora with faster query times have shorter cache durations (2-15 minutes) to ensure fresher data.
The corpus_key uniquely identifies the corpus. For more information, see Create a corpus.
Request
Responses
- 200
- 400
- 403
- 404
Successfully retrieved filter attribute statistics for the corpus.
Bad request - invalid parameters or corpus does not support filter attribute statistics (not backed by OpenSearch).
Permissions do not allow retrieving filter attribute statistics for this corpus.
Corpus not found.