Use simple_query_string for user search
What does this MR do and why?
Updates advanced user search so that
- if
user_search_simple_query_string
feature flag is enabled and the query string has characters used for advanced user search ([+-|*()~"]
) - else
By using simple_query_string
, the user can refine the search and by using match
with fuzziness
we can get around misspelling of a person's name/username by showing options that are close to the searched term.
Screenshots or screen recordings
A few examples:
How to set up and validate locally
- Ensure Elasticsearch is running locally
- Enable the feature flags:
Feature.enable(:advanced_user_search)
andFeature.enable(:user_search_simple_query_string)
- Do a normal user search. E.g.
/search?scope=users&search=ivan
- Do a user search with advanced search syntax. E.g.
/search?scope=users&search=iva*
- Disable the feature flag:
Feature.enable(:user_search_simple_query_string)
- Do a user search with advanced search syntax and notice that the syntax wasn't used.
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 #388409 (closed)
Edited by Madelein van Niekerk