From 4952df54aa856864fad8dd64512a666e8343a15b Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 24 Feb 2021 15:30:13 -0600 Subject: [PATCH] GBL Harvester: add solr_bboxtype fields to document_transformer Fixes #100 --- lib/geo_combine/geo_blacklight_harvester.rb | 4 ++++ spec/lib/geo_combine/geo_blacklight_harvester_spec.rb | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/geo_combine/geo_blacklight_harvester.rb b/lib/geo_combine/geo_blacklight_harvester.rb index a68ba2c..8dec715 100644 --- a/lib/geo_combine/geo_blacklight_harvester.rb +++ b/lib/geo_combine/geo_blacklight_harvester.rb @@ -34,6 +34,10 @@ def document_transformer document.delete('_version_') document.delete('score') document.delete('timestamp') + document.delete('solr_bboxtype__minX') + document.delete('solr_bboxtype__minY') + document.delete('solr_bboxtype__maxX') + document.delete('solr_bboxtype__maxY') document end end diff --git a/spec/lib/geo_combine/geo_blacklight_harvester_spec.rb b/spec/lib/geo_combine/geo_blacklight_harvester_spec.rb index 1b0e650..5d58d4b 100644 --- a/spec/lib/geo_combine/geo_blacklight_harvester_spec.rb +++ b/spec/lib/geo_combine/geo_blacklight_harvester_spec.rb @@ -49,7 +49,7 @@ describe 'document tranformations' do let(:docs) do [ - { layer_slug_s: 'abc-123', _version_: '1', timestamp: '1999-12-31', score: 0.1 }, + { layer_slug_s: 'abc-123', _version_: '1', timestamp: '1999-12-31', score: 0.1, solr_bboxtype__minX: -87.324704, solr_bboxtype__minY: 40.233691, solr_bboxtype__maxX: -87.174404, solr_bboxtype__maxY: 40.310695 }, { layer_slug_s: 'abc-321', dc_source_s: 'abc-123' } ] end @@ -68,7 +68,7 @@ expect(stub_solr_connection).to receive(:update).with( hash_including( data: [ - { layer_slug_s: 'abc-123', timestamp: '1999-12-31', score: 0.1 }, + { layer_slug_s: 'abc-123', timestamp: '1999-12-31', score: 0.1, solr_bboxtype__minX: -87.324704, solr_bboxtype__minY: 40.233691, solr_bboxtype__maxX: -87.174404, solr_bboxtype__maxY: 40.310695 }, { layer_slug_s: 'abc-321', dc_source_s: 'abc-123' } ].to_json ) @@ -79,7 +79,7 @@ end context 'when no transformer is set' do - it 'removes the _version_, timestamp, and score fields' do + it 'removes the _version_, timestamp, score, and solr_bboxtype__* fields' do expect(stub_solr_connection).to receive(:update).with( hash_including( data: [