Skip to content

Commit

Permalink
Merge pull request #2630 from alphagov/send-policy-areas-to-rumager
Browse files Browse the repository at this point in the history
Pass policy_areas to rummager instead of topics for indexing
  • Loading branch information
MatMoore committed Jun 27, 2016
2 parents a7bb08f + 7eea096 commit 3d9d3d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/models/searchable.rb
Expand Up @@ -33,7 +33,10 @@ module Searchable
:speech_type,
:statistics_announcement_state,
:title,

# Topics display as policy areas in the frontend and map to policy areas in rummager
:topics,

:world_locations,
]

Expand Down Expand Up @@ -84,9 +87,11 @@ module Mixin
extend ActiveSupport::Concern

KEY_MAPPING = {
content: 'indexable_content'
content: 'indexable_content',
topics: 'policy_areas',
}

# Build the payload to pass to the search index
def search_index
SEARCH_FIELDS.reduce({}) do |result, name|
value = searchable_options[name].call(self)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/statistics_announcement_test.rb
Expand Up @@ -64,7 +64,7 @@ class StatisticsAnnouncementTest < ActiveSupport::TestCase
'format' => 'statistics_announcement',
'description' => announcement.summary,
'organisations' => announcement.organisations.map(&:slug),
'topics' => announcement.topics.map(&:slug),
'policy_areas' => announcement.topics.map(&:slug),
'display_type' => announcement.display_type,
'slug' => announcement.slug,
'release_timestamp' => announcement.release_date,
Expand Down

0 comments on commit 3d9d3d7

Please sign in to comment.