Skip to content

Commit

Permalink
Removed extra filters, type of territory and parcc_info
Browse files Browse the repository at this point in the history
Ticket #72
  • Loading branch information
Ben Tregenna authored and Ben Tregenna committed Aug 8, 2019
1 parent 1bb074b commit d7666c5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 50 deletions.
26 changes: 0 additions & 26 deletions config/search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 0 additions & 14 deletions test/integration/search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 0 additions & 10 deletions test/unit/search/aggregation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d7666c5

Please sign in to comment.