Allow searching by iid and sort results
What does this MR do and why?
This MR updates the advanced search functionality for work items by adding two key features:
- Search by IID: Allows users to search for work items by their internal ID (iid) when using advanced search with Elasticsearch.
-
Sorting capabilities: Implements comprehensive sorting options for work items (see related documenentation) in advanced search results, including:
- Created date (asc/desc)
- Updated date (asc/desc)
- Weight (asc/desc)
- Health status (asc/desc)
- Closed date (asc/desc)
- Due date (asc/desc)
- Milestone due date (asc/desc)
- Popularity (asc/desc)
title asc/desc is not included since we need to update the mappings to add title as keyword. Currently ES does not allow sorting by text fields.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Follow this guide to have ES enabled locally for GDK
- GLQL relies on
crypto.subtle, which is unavailable in insecure contexts (except forlocalhost), it won’t work if you're using a custom URL likehttp://gdk.test:3000locally. To resolve this, one of the options is to enable HTTPS in GDK by following this link. - Enable the following feature flags in
rails c:
=> Feature.enable(:glql_work_items)
=> Feature.enable(:glql_es_integration)
- Navigate to any issue comment or description field where Markdown is supported
- Add the following GLQL query into the field and try out sorting with various supported sorting options (https://docs.gitlab.com/user/glql/fields/#fields-to-sort-embedded-views-by):
```glql
display: table
fields: title, labels, milestone
query: group = "gitlab-org" and label = "group::knowledge"
sort: updated desc
```
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #562593 (closed)
Edited by Alisa Frunza