Add 'count' endpoint
It's been suggested (by Brian Rosmaita) that something that might be useful, especially when looking at multi-region deployments, is the ability to quickly get a summary of counts of types.
We don't expose the aggregations API directly (perhaps we should) but even if we did, it would be useful similarly to facets to expose an explicit endpoint to return a summary of accessible result counts in the format:
{"OS::Nova:
I don't see any reason not to allow queries and the usual index/type restrictions similar to faceting; this will be a shortcut to insert the aggregation and set size=0 on a query, plus formatting the results in a nicer fashion.
This doesn't preclude adding the ability to run arbitrary aggregations; it's a convenience function with a very clear remit (just as facets).
EDIT - in fact, it occurs that this could be part of the facet response since it's very similar, though unfortunately the facet api response is {"resource type": [facets]} which doesn't lend itself well to adding additional info.
Blueprint information
- Status:
- Complete
- Approver:
- Travis Tripp
- Priority:
- Medium
- Drafter:
- Steve McLellan
- Direction:
- Approved
- Assignee:
- Steve McLellan
- Definition:
- Approved
- Series goal:
- Accepted for newton
- Implementation:
- Implemented
- Milestone target:
- newton-3
- Started by
- Travis Tripp
- Completed by
- Travis Tripp
Related branches
Related bugs
Sprints
Whiteboard
After some discussion, our decision is to go with altering the facets endpoint but maintaining back-compatilbility through newton.
We'll add ?include_totals and ?include_fields to the /facet endpoint. The presence of either will result in the return document following the format {"resource_type": {"doc_count": 4, "facets": [facets]}}. The UI and client will be updated to expect the new format, and explicitly pass these options.
For Newton, if neither is specified, the existing format will be preserved (treating the default as include_
Gerrit topic: https:/
Addressed by: https:/
Add totals to facets
Gerrit topic: https:/
Addressed by: https:/
Support new facet response format
Addressed by: https:/
Handle new-format facets response