Skip to content

Make code-like content findable in merge requests for advanced search

What does this MR do and why?

This MR adds the code_analyzer for the description and title_analyzer for the title in the merge_requests index. In addition to that I have added a migration ReindexMergeRequestToUpdateAnalyzer which uses Zero downtime reindexing to reindex all the epics to use the new analyzers.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Make sure Elastic search is enabled

On the master branch:

Testing for title

  • Create an MR with the title dots.also.need.testing
  • Make sure this new MR is available on Elasticsearch. You might need to wait a bit or sometimes restart the rails-background-jobs
  • Now perform a group search under the MR's group with the keyword also.need
  • You won't find the created MR in the search results
  • Repeat the process for the following table and you should not see the result.
Title of the MR Search Query
köln koln
koln_berlin koln
kolnBerlin koln

Testing for description

  • Create an MR with a description dots.also.need.testing
  • Make sure this new MR is available on Elasticsearch. You might need to wait a bit or sometimes restart the rails-background-jobs
  • Now perform a group search under the MR's group with the keyword also.need
  • You won't find the created MR in the search results

Now switch to the MR branch

Testing for title

  • Run the bundle exec rake gitlab:elastic:index to reindex the MRs with the new analyzer
  • Make sure this new MR is available on Elasticsearch. You might need to wait a bit or sometimes restart the rails-background-jobs
  • Now perform a project search under the MR's group with the keyword also.need
  • You will find the created MR in the search results
  • Repeat the process for the following table and you should see the result.
Title of the MR Search Query
köln koln
koln_berlin koln
kolnBerlin koln

Testing for description

  • Create an MR with a description dots.also.need.testing
  • Make sure this new MR is available on Elasticsearch. You might need to wait a bit or sometimes restart the rails-background-jobs
  • Now perform a group search under the MR's group with the keyword also.need
  • You find the created MR in the search results

Migration run time

~2.3 hours

Related to #433258 (closed)

Edited by Ravi Kumar

Merge request reports