ドキュメント
Aggregate
Group and count vectors by metadata fields for analytics and faceted browsing.
bashPOST /v1/aggregateGroup vectors in a collection by a metadata key and return counts per group. Useful for building faceted navigation, analytics dashboards, and data quality checks.
| Parameter | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | Collection name |
group_by | string | Yes | Metadata key to group by |
filter_key | string | No | Filter to a subset before grouping |
filter_value | string | No | Value for the filter key |
bash# Count documents by category
curl -X POST https://api.schift.io/v1/aggregate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SCHIFT_API_KEY" \
-d '{
"collection": "product-docs",
"group_by": "category"
}'
# Count within a filtered subset
curl -X POST https://api.schift.io/v1/aggregate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SCHIFT_API_KEY" \
-d '{
"collection": "product-docs",
"group_by": "author",
"filter_key": "category",
"filter_value": "engineering"
}'Response: { "groups": [{"value": "engineering", "count": 42}, ...], "total": 156 }
Backend support
Aggregate is supported by the Schift engine and FAISS backends. Other backends return 501.