From d7666c5c5e5660d25f4802b6c5e2bbf8af620d44 Mon Sep 17 00:00:00 2001 From: Ben Tregenna Date: Thu, 8 Aug 2019 15:50:55 +0100 Subject: [PATCH] Removed extra filters, type of territory and parcc_info Ticket #72 --- config/search.yml | 26 -------------------------- test/integration/search_test.rb | 14 -------------- test/unit/search/aggregation_test.rb | 10 ---------- 3 files changed, 50 deletions(-) diff --git a/config/search.yml b/config/search.yml index 38eee57d6..af7a4ccce 100644 --- a/config/search.yml +++ b/config/search.yml @@ -38,32 +38,6 @@ titles: property: "name" template: "Protected Areas with Governance '%s'" aggregations: - type_of_territory: - type: "boolean" - query: "marine" - labels: - 1: "Marine" - 0: "Terrestrial" - identifiers: - 1: true - 0: false - related_sources: - type: "grouped" - members: - has_parcc_info: - type: "boolean" - query: "has_parcc_info" - labels: - 1: "Vulnerability Assessment" - identifiers: - 1: true - has_irreplaceability_info: - type: "boolean" - query: "has_irreplaceability_info" - labels: - 1: "Irreplaceability Assessment" - identifiers: - 1: true country: type: "model" class: "Country" diff --git a/test/integration/search_test.rb b/test/integration/search_test.rb index 604637d2d..67c15a669 100644 --- a/test/integration/search_test.rb +++ b/test/integration/search_test.rb @@ -234,20 +234,6 @@ def assert_aggregation expected, name, value, aggs assert_equal 1, search.results.count end - test 'search with marine aggregation' do - region = FactoryGirl.create(:region, id: 987, name: 'North Manmerica') - country = FactoryGirl.create(:country, id: 123, iso_3: 'MBN', name: 'Manbone land', region: region) - - pa1 = FactoryGirl.create(:protected_area, name: "Protected Forest", wdpa_id: 1, countries: [country], marine: true) - pa2 = FactoryGirl.create(:protected_area, name: "Blue Forest", wdpa_id: 3, countries: [country], marine: false) - - assert_index 1, 2 - search = Search.search 'forest', {} - - assert_aggregation 1, 'type_of_territory', 'Marine', search.aggregations - assert_aggregation 1, 'type_of_territory', 'Terrestrial', search.aggregations - end - test 'search with country aggregation' do region = FactoryGirl.create(:region, id: 987, name: 'North Manmerica') country1 = FactoryGirl.create(:country, id: 123, iso_3: 'MBN', name: 'Manbone land', region: region) diff --git a/test/unit/search/aggregation_test.rb b/test/unit/search/aggregation_test.rb index 94dd30331..c91e267f5 100644 --- a/test/unit/search/aggregation_test.rb +++ b/test/unit/search/aggregation_test.rb @@ -3,16 +3,6 @@ class SearchAggregationTest < ActiveSupport::TestCase test '#all returns a hash with all aggregations configurations' do expected_aggregations = { - "type_of_territory" => { - "terms" => { - "field" => "marine" - } - }, - "has_parcc_info" => { - "terms" => { - "field" => "has_parcc_info" - } - }, "is_green_list" => { "terms" => { "field" => "is_green_list"