Advanced search - allow queries for milestone in work item index

Problem to solve

We're working on a proof of concept for GLQL to hook into advanced search. The two most important fields are milestone (not present) and labels (present). Both fields are needed to do the proof of concept

https://docs.gitlab.com/user/glql/fields/#milestone

Important

Filtering by started, not_started, upcoming and not_upcoming is out of the scope if this issue because we do not have all the necessary fields for these queries in the work items index (see related issue #540792 (closed)). This will be implemented in a separate issue.

Proposal

This work is blocked by #525883 (closed) which adds milestone_title data to the work item index and backfills it.

Support querying by milestone for work items.

It must support =in!= operations to mimic GLQL as well as the supported input types:

  • milestone (example %Backlog, %"Awaiting Further Demand")
  • array (example (%17.7, %17.8))
  • string (example: upcoming, started (will be done in a separate issue), none, any)

Add to the query builder

  1. Add a new filter to Search::Elastic::Filters called by_milestone. A terms query in combination with bool query can allow =/in to be served by milestone param and != to be served by not_milestone
  2. Add the new filter to the `WorkItemQueryBuilder
Expose to search service (TBD if needed)
  1. Add a two new params called milestone and not_milestone to the filters in EE::Search::Filter concern
Edited by Alisa Frunza