This has been done before for the old issues filter.
See gitlab-ce#18120 and gitlab-ce!4763 for details.