terms_aggregation
Aggregate documents by a field to return the top values with counts, optionally filtered by a query.
Instructions
Get top values for a field (terms aggregation).
Args: index: Index to aggregate. field: Field to get top values for (must be keyword or numeric). size: Number of top terms to return (default: 10). query: Optional query to filter documents.
Returns: Top field values with document counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | ||
| field | Yes | ||
| size | No | ||
| query | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||