Skip to content

Advanced Search: Add meta field to indices mapping

Dmitry Gruzd requested to merge 349124-add-meta-field-to-indices-mappings into master

What does this MR do and why?

This MR adds _meta field to every Elasticsearch index for debugging purposes. As the first iteration we'll add Gitlab::VERSION of the installation that created these indices.

#349124 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  1. Enable Advanced Search if it's not configured
  2. Checkout the branch of this MR
  3. Create an empty index by running:
    Gitlab::Elastic::Helper.default.create_empty_index(with_alias: false)
  4. Note the index name which looks like gitlab-development-20211222-1716 and execute the command using it as a path. For example:
    $ curl -s http://localhost:9200/gitlab-development-20211222-1716/_mappings | jq ".[].mappings._meta"
    {
     "created_by": "14.7.0-pre"
    }
  5. Ensure that it outputs current GitLab version
  6. Delete the newly created index by running:
    curl -XDELETE http://localhost:9200/gitlab-development-20211222-1716

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #349124 (closed)

Edited by Dmitry Gruzd

Merge request reports

Loading