Grouping allows you to cluster related search results together, making it easier to analyze and present content with shared characteristics.

Group Types

Default Grouping

  • Asset ID grouping
  • Metadata field grouping
  • Feature type grouping
  • Custom field grouping

Group Properties

  • Maximum features per group
  • Internal group sorting
  • Group metadata
  • Group statistics

Configuration

Configuration Options

Common Use Cases

{
  "group_by": {
    "field": "document_id",
    "max_features": 15,
    "sort": {
      "field": "page_number",
      "direction": "asc"
    }
  }
}

Response Format

{
  "groups": [
    {
      "key": "document_123",
      "total_features": 45,
      "features": [...],
      "metadata": {
        "document_type": "pdf",
        "total_pages": 12
      }
    }
  ],
  "total_groups": 5
}

Best Practices

1

Choose Meaningful Groups

Select grouping fields that create logical content clusters

2

Optimize Group Size

Balance between completeness and performance

3

Use Efficient Sorting

Sort groups internally using indexed fields

4

Handle Edge Cases

Account for empty groups and varying group sizes

Limitations

Be aware of these technical constraints:

  • Maximum 50 features per group
  • Only predefined fields supported for grouping
  • No cross-group operations
  • Not compatible with offset pagination

For detailed implementation examples, see the Search API Reference.