diff --git a/GITLAB_ELASTICSEARCH_INDEXER_VERSION b/GITLAB_ELASTICSEARCH_INDEXER_VERSION
index 437459cd94c9fa59d82c61c0bc8aa36e293b735e..e70b4523ae7ffe8aa3cac8ecd1b093fba5a98737 100644
--- a/GITLAB_ELASTICSEARCH_INDEXER_VERSION
+++ b/GITLAB_ELASTICSEARCH_INDEXER_VERSION
@@ -1 +1 @@
-2.5.0
+2.6.0
diff --git a/ee/changelogs/unreleased/5870-elasticsearch-id-is-too-long-must-be-no-longer-than-512-bytes.yml b/ee/changelogs/unreleased/5870-elasticsearch-id-is-too-long-must-be-no-longer-than-512-bytes.yml
new file mode 100644
index 0000000000000000000000000000000000000000..e2baf49d84a8e5a05cb9da2c29d270d5961b7323
--- /dev/null
+++ b/ee/changelogs/unreleased/5870-elasticsearch-id-is-too-long-must-be-no-longer-than-512-bytes.yml
@@ -0,0 +1,5 @@
+---
+title: Support Indexing files in Elasticsearch with paths longer than 512 bytes
+merge_request: 37834
+author:
+type: fixed
diff --git a/ee/spec/lib/gitlab/elastic/indexer_spec.rb b/ee/spec/lib/gitlab/elastic/indexer_spec.rb
index 2f7e8a2b9ddfb8710ff0370408dda5556d3c6d8f..53018c0b483350bf35fd6063e3f6ab96d015799e 100644
--- a/ee/spec/lib/gitlab/elastic/indexer_spec.rb
+++ b/ee/spec/lib/gitlab/elastic/indexer_spec.rb
@@ -373,6 +373,21 @@ def indexed_wiki_paths_for(term)
     end
   end
 
+  context 'when a file path is larger than elasticsearch max size of 512 bytes', :elastic do
+    let(:long_path) { "#{'a' * 1000}_file.txt" }
+
+    before do
+      project.repository.create_file(user, long_path, 'Large path file contents', message: 'long_path.txt', branch_name: 'master')
+
+      index_repository(project)
+    end
+
+    it 'indexes the file' do
+      files = indexed_file_paths_for('file')
+      expect(files).to include(long_path)
+    end
+  end
+
   def expect_popen
     expect(Gitlab::Popen).to receive(:popen)
   end