From c6a4c3382e847951614b89f3ec7efd528198bbf3 Mon Sep 17 00:00:00 2001 From: "Marcos G. Zimmermann" Date: Fri, 12 Jul 2024 13:51:48 -0300 Subject: [PATCH] fix: es 1.x does not include _routing in the response --- spec/support/shared_examples/repository_documents_import.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/support/shared_examples/repository_documents_import.rb b/spec/support/shared_examples/repository_documents_import.rb index 3dfb92b..5139602 100644 --- a/spec/support/shared_examples/repository_documents_import.rb +++ b/spec/support/shared_examples/repository_documents_import.rb @@ -146,7 +146,7 @@ context 'when the document routing is set' do include_context 'with stories index definition' - it 'indexes the data and bulk updates all the document routing' do + it 'indexes the data and bulk updates all the document routing' do |example| es_client do |client, _conf, cluster| StoriesIndex.create_index(alias: true) @@ -162,7 +162,9 @@ doc = StoriesIndex.get(id: '1001', routing: 'nyt') expect(doc.dig('_source', 'publication')).to eq('nyt') expect(doc.dig('_source', 'tags')).to be(nil) - expect(doc.dig('_routing')).to eq('nyt') + unless %w[1.x].include?(example.metadata[:es_version]) + expect(doc.dig('_routing')).to eq('nyt') + end end end