Labels as a facet: Aggregations API for labels
What does this MR do and why?
This feature is behind a feature flag search_issue_label_aggregation
.
This MR adds issues
to the SearchController#aggregations
endpoint. It uses the new label_ids
field that has been introduced in !96153 (merged).
This is how an example response looks like:
[
{
"name": "labels",
"buckets": [
{
"key": "115",
"count": 390,
"title": "Awaiting feedback",
"color": "#fef2c0",
"type": "ProjectLabel",
"parent_full_name": "qa-perf-testing / gitlabhq"
}
]
}
]
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Enable Advanced Search
- Enable the feature flag
Feature.enable(:search_issue_label_aggregation)
- Execute
curl "http://localhost:3000/search/aggregations?scope=issues&search=*"
- Ensure that this command returns all indexed labels for issues
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #369540 (closed)
Edited by Dmitry Gruzd