diff --git a/ee/elastic/docs/20240119130539_reindex_notes_to_update_analyzer.yml b/ee/elastic/docs/20240119130539_reindex_notes_to_update_analyzer.yml
new file mode 100644
index 0000000000000000000000000000000000000000..71d7a9d1ea95a20acb25dfb7b6b202912950462c
--- /dev/null
+++ b/ee/elastic/docs/20240119130539_reindex_notes_to_update_analyzer.yml
@@ -0,0 +1,10 @@
+---
+name: ReindexNotesToUpdateAnalyzer
+version: '20240119130539'
+description: This migration reindexes the notes index to start using new analyzer for notes.note
+group: group::global search
+milestone: '16.9'
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142301
+obsolete: false
+marked_obsolete_by_url:
+marked_obsolete_in_milestone:
diff --git a/ee/elastic/migrate/20240119130539_reindex_notes_to_update_analyzer.rb b/ee/elastic/migrate/20240119130539_reindex_notes_to_update_analyzer.rb
new file mode 100644
index 0000000000000000000000000000000000000000..ddb293cf7d943f60c7e63523237ac28b02733585
--- /dev/null
+++ b/ee/elastic/migrate/20240119130539_reindex_notes_to_update_analyzer.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ReindexNotesToUpdateAnalyzer < Elastic::Migration
+  def migrate
+    Elastic::ReindexingTask.create!(targets: %w[Note], options: { skip_pending_migrations_check: true })
+  end
+
+  def completed?
+    true
+  end
+end
diff --git a/ee/lib/elastic/latest/note_config.rb b/ee/lib/elastic/latest/note_config.rb
index fcb55b5f6152a2c5f21a11f3f55b817c9098d03b..4313ee1217bb33cdc0ae5e2e53a0aa412bdf7328 100644
--- a/ee/lib/elastic/latest/note_config.rb
+++ b/ee/lib/elastic/latest/note_config.rb
@@ -21,7 +21,7 @@ module NoteConfig
 
         indexes :id, type: :integer
 
-        indexes :note, type: :text, index_options: 'positions'
+        indexes :note, type: :text, index_options: 'positions', analyzer: :code_analyzer
         indexes :project_id, type: :integer
 
         indexes :noteable_type, type: :keyword
diff --git a/ee/spec/elastic/migrate/20240119130539_reindex_notes_to_update_analyzer_spec.rb b/ee/spec/elastic/migrate/20240119130539_reindex_notes_to_update_analyzer_spec.rb
new file mode 100644
index 0000000000000000000000000000000000000000..b6e0ea081910ca03ace3aa05f0ae9563983278e7
--- /dev/null
+++ b/ee/spec/elastic/migrate/20240119130539_reindex_notes_to_update_analyzer_spec.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_relative 'migration_shared_examples'
+require File.expand_path('ee/elastic/migrate/20240119130539_reindex_notes_to_update_analyzer.rb')
+
+RSpec.describe ReindexNotesToUpdateAnalyzer, feature_category: :global_search do
+  let(:version) { 20240119130539 }
+  let(:migration) { described_class.new(version) }
+
+  it 'does not have migration options set', :aggregate_failures do
+    expect(migration).not_to be_batched
+    expect(migration).not_to be_retry_on_failure
+  end
+
+  describe '#migrate' do
+    it 'creates reindexing task with correct target and options' do
+      expect { migration.migrate }.to change { Elastic::ReindexingTask.count }.by(1)
+      task = Elastic::ReindexingTask.last
+      expect(task.targets).to eq(%w[Note])
+      expect(task.options).to eq({ 'skip_pending_migrations_check' => true })
+    end
+  end
+
+  describe '#completed?' do
+    it 'always returns true' do
+      expect(migration.completed?).to eq(true)
+    end
+  end
+end
diff --git a/ee/spec/lib/gitlab/elastic/search_results_spec.rb b/ee/spec/lib/gitlab/elastic/search_results_spec.rb
index ae813aef486b129636e21eafa979654ded2cccef..0faa50f57542e0fb24d3cfeb2992d0e4aeff4142 100644
--- a/ee/spec/lib/gitlab/elastic/search_results_spec.rb
+++ b/ee/spec/lib/gitlab/elastic/search_results_spec.rb
@@ -14,53 +14,6 @@
   let(:project_2) { create(:project, :public, :repository, :wiki_repo) }
   let(:limit_project_ids) { [project_1.id] }
 
-  shared_context 'with elastic code examples' do
-    let(:code_examples) do
-      {
-        'perlMethodCall' => '$my_perl_object->perlMethodCall',
-        '"absolute_with_specials.txt"' => '/a/longer/file-path/absolute_with_specials.txt',
-        '"components-within-slashes"' => '/file-path/components-within-slashes/',
-        'bar\(x\)' => 'Foo.bar(x)',
-        'someSingleColonMethodCall' => 'LanguageWithSingleColon:someSingleColonMethodCall',
-        'javaLangStaticMethodCall' => 'MyJavaClass::javaLangStaticMethodCall',
-        'IllegalStateException' => 'java.lang.IllegalStateException',
-        'tokenAfterParentheses' => 'ParenthesesBetweenTokens)tokenAfterParentheses',
-        'ruby_call_method_123' => 'RubyClassInvoking.ruby_call_method_123(with_arg)',
-        'ruby_method_call' => 'RubyClassInvoking.ruby_method_call(with_arg)',
-        '#ambitious-planning' => 'We [plan ambitiously](#ambitious-planning).',
-        'ambitious-planning' => 'We [plan ambitiously](#ambitious-planning).',
-        'tokenAfterCommaWithNoSpace' => 'WouldHappenInManyLanguages,tokenAfterCommaWithNoSpace',
-        'missing_token_around_equals' => 'a.b.c=missing_token_around_equals',
-        'and;colons:too$' => 'and;colons:too$',
-        '"differeñt-lønguage.txt"' => 'another/file-path/differeñt-lønguage.txt',
-        '"relative-with-specials.txt"' => 'another/file-path/relative-with-specials.txt',
-        'ruby_method_123' => 'def self.ruby_method_123(ruby_another_method_arg)',
-        'ruby_method_name' => 'def self.ruby_method_name(ruby_method_arg)',
-        '"dots.also.need.testing"' => 'dots.also.need.testing',
-        '.testing' => 'dots.also.need.testing',
-        'dots' => 'dots.also.need.testing',
-        'also.need' => 'dots.also.need.testing',
-        'need' => 'dots.also.need.testing',
-        'tests-image' => 'extends: .gitlab-tests-image',
-        'gitlab-tests' => 'extends: .gitlab-tests-image',
-        'gitlab-tests-image' => 'extends: .gitlab-tests-image',
-        'foo/bar' => 'https://s3.amazonaws.com/foo/bar/baz.png',
-        'https://test.or.dev.com/repository' => 'https://test.or.dev.com/repository/maven-all',
-        'test.or.dev.com/repository/maven-all' => 'https://test.or.dev.com/repository/maven-all',
-        'repository/maven-all' => 'https://test.or.dev.com/repository/maven-all',
-        'https://test.or.dev.com/repository/maven-all' => 'https://test.or.dev.com/repository/maven-all',
-        'bar-baz-conventions' => 'id("foo.bar-baz-conventions")',
-        'baz-conventions' => 'id("foo.bar-baz-conventions")',
-        'baz' => 'id("foo.bar-baz-conventions")',
-        'bikes-3.4' => 'include "bikes-3.4"',
-        'sql_log_bin' => 'q = "SET @@session.sql_log_bin=0;"',
-        'sql_log_bin=0' => 'q = "SET @@session.sql_log_bin=0;"',
-        'v3/delData' => 'uri: "v3/delData"',
-        '"us-east-2"' => 'us-east-2'
-      }
-    end
-  end
-
   describe '#highlight_map' do
     using RSpec::Parameterized::TableSyntax
 
@@ -533,6 +486,26 @@
       expect(results.notes_count).to eq 2
     end
 
+    context 'when comment has some code snippet' do
+      before do
+        code_examples.values.uniq.each do |note|
+          sha = Digest::SHA256.hexdigest(note)
+          create(:note_on_issue, noteable: issue, project: project_1, commit_id: sha, note: note)
+        end
+        ensure_elasticsearch_index!
+      end
+
+      include_context 'with code examples' do
+        it 'finds all examples' do
+          code_examples.each do |query, description|
+            sha = Digest::SHA256.hexdigest(description)
+            notes = described_class.new(user, query, limit_project_ids).objects('notes')
+            expect(notes.map(&:commit_id)).to include(sha)
+          end
+        end
+      end
+    end
+
     it 'returns empty list when notes are not found' do
       results = described_class.new(user, 'security', limit_project_ids)
 
@@ -1096,7 +1069,7 @@ def search_for(term)
         ensure_elasticsearch_index!
       end
 
-      include_context 'with elastic code examples' do
+      include_context 'with code examples' do
         it 'finds all examples' do
           code_examples.each do |search_term, file_content|
             file_name = Digest::SHA256.hexdigest(file_content)
@@ -1308,7 +1281,7 @@ def search_for(term)
           )
         end
 
-        include_context 'with elastic code examples' do
+        include_context 'with code examples' do
           before do
             examples.values.uniq.each do |description|
               sha = Digest::SHA256.hexdigest(description)
diff --git a/ee/spec/support/shared_contexts/search/elastic/with_code_examples_shared_context.rb b/ee/spec/support/shared_contexts/search/elastic/with_code_examples_shared_context.rb
new file mode 100644
index 0000000000000000000000000000000000000000..98b5e6ef6131357dcfc8052e6314a41b60d10be6
--- /dev/null
+++ b/ee/spec/support/shared_contexts/search/elastic/with_code_examples_shared_context.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+
+RSpec.shared_context 'with code examples' do
+  let(:code_examples) do
+    {
+      'perlMethodCall' => '$my_perl_object->perlMethodCall',
+      '"absolute_with_specials.txt"' => '/a/longer/file-path/absolute_with_specials.txt',
+      '"components-within-slashes"' => '/file-path/components-within-slashes/',
+      'bar\(x\)' => 'Foo.bar(x)',
+      'someSingleColonMethodCall' => 'LanguageWithSingleColon:someSingleColonMethodCall',
+      'javaLangStaticMethodCall' => 'MyJavaClass::javaLangStaticMethodCall',
+      'IllegalStateException' => 'java.lang.IllegalStateException',
+      'tokenAfterParentheses' => 'ParenthesesBetweenTokens)tokenAfterParentheses',
+      'ruby_call_method_123' => 'RubyClassInvoking.ruby_call_method_123(with_arg)',
+      'ruby_method_call' => 'RubyClassInvoking.ruby_method_call(with_arg)',
+      '#ambitious-planning' => 'We [plan ambitiously](#ambitious-planning).',
+      'ambitious-planning' => 'We [plan ambitiously](#ambitious-planning).',
+      'tokenAfterCommaWithNoSpace' => 'WouldHappenInManyLanguages,tokenAfterCommaWithNoSpace',
+      'missing_token_around_equals' => 'a.b.c=missing_token_around_equals',
+      'and;colons:too$' => 'and;colons:too$',
+      '"differeñt-lønguage.txt"' => 'another/file-path/differeñt-lønguage.txt',
+      '"relative-with-specials.txt"' => 'another/file-path/relative-with-specials.txt',
+      'ruby_method_123' => 'def self.ruby_method_123(ruby_another_method_arg)',
+      'ruby_method_name' => 'def self.ruby_method_name(ruby_method_arg)',
+      '"dots.also.need.testing"' => 'dots.also.need.testing',
+      '.testing' => 'dots.also.need.testing',
+      'dots' => 'dots.also.need.testing',
+      'also.need' => 'dots.also.need.testing',
+      'need' => 'dots.also.need.testing',
+      'tests-image' => 'extends: .gitlab-tests-image',
+      'gitlab-tests' => 'extends: .gitlab-tests-image',
+      'gitlab-tests-image' => 'extends: .gitlab-tests-image',
+      'foo/bar' => 'https://s3.amazonaws.com/foo/bar/baz.png',
+      'https://test.or.dev.com/repository' => 'https://test.or.dev.com/repository/maven-all',
+      'test.or.dev.com/repository/maven-all' => 'https://test.or.dev.com/repository/maven-all',
+      'repository/maven-all' => 'https://test.or.dev.com/repository/maven-all',
+      'https://test.or.dev.com/repository/maven-all' => 'https://test.or.dev.com/repository/maven-all',
+      'bar-baz-conventions' => 'id("foo.bar-baz-conventions")',
+      'baz-conventions' => 'id("foo.bar-baz-conventions")',
+      'baz' => 'id("foo.bar-baz-conventions")',
+      'bikes-3.4' => 'include "bikes-3.4"',
+      'sql_log_bin' => 'q = "SET @@session.sql_log_bin=0;"',
+      'sql_log_bin=0' => 'q = "SET @@session.sql_log_bin=0;"',
+      'v3/delData' => 'uri: "v3/delData"',
+      '"us-east-2"' => 'us-east-2'
+    }
+  end
+end