Skip to content

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

  1. Ensure Elasticsearch is running locally
  2. Enable the feature flags: Feature.enable(:advanced_user_search) and Feature.enable(:user_search_simple_query_string)
  3. Do a normal user search. E.g. /search?scope=users&search=ivan
  4. Do a user search with advanced search syntax. E.g. /search?scope=users&search=iva*
  5. Disable the feature flag: Feature.enable(:user_search_simple_query_string)
  6. 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.

Related to #388409 (closed)

Edited by Madelein van Niekerk

Merge request reports

Loading