Skip to content

Indexing for newly created GroupWiki

Ravi Kumar requested to merge 336100-index-group-wiki-to-separate-index into master

What does this MR do and why?

This MR will index any newly created group wikis. When a group wiki gets updated or delete it will reindex all the wikis of that group and all the wikis of all subgroups of that group. I have rearranged each commit nicely with more explanation in the commit body of each commit.

Screenshots or screen recordings

Screenshot_2023-05-11_at_11.27.52 Missing project_id in the screenshot and rid as wiki_group_ shows that this is a group wiki.

How to set up and validate locally

  1. Make sure the elasticsearch is enabled. Navigate to the elasticsearch settings and make sure the two checkboxes Elasticsearch indexing and Search with Elasticsearch enabled under the Advanced Search are enabled.
  2. Make sure the feature flag maintain_group_wiki_index is enabled. run the following command in rails console
Feature.enabled :maintain_group_wiki_index
  1. Create a new GroupWiki
  2. Make sure it gets available on the elasticsearch with the correct attributes:
curl -XGET "http://localhost:9200/gitlab-development-wikis/_search" -H "kbn-xsrf: reporting" -H "Content-Type: application/json" -d'
{
  "query": {
    "regexp": {
      "rid": "wiki_group_[0-9].*"
    }
  }
}' | json_pp
  1. Update the wiki content from the UI and verify again that content gets updated in the elastic by running the above command.
  2. Delete the wiki from the UI and verify that the documents get removed from the elastic by running the above command.

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 #336100 (closed)

Edited by Ravi Kumar

Merge request reports

Loading