Skip to content

Commit

Permalink
Merge pull request #169 from alphagov/new-filters
Browse files Browse the repository at this point in the history
Add new filterable fields to allowlist
  • Loading branch information
csutter authored Jan 5, 2024
2 parents 586bf45 + c53c80e commit a9a4442
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/services/discovery_engine/query/filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ module DiscoveryEngine::Query
class Filters
FILTER_PARAM_KEY_REGEX = /\A(filter_all|filter|reject)_(.+)\z/

FILTERABLE_STRING_FIELDS = %w[content_purpose_supergroup link part_of_taxonomy_tree].freeze
FILTERABLE_STRING_FIELDS = %w[
content_purpose_supergroup
link
manual
organisations
part_of_taxonomy_tree
topical_events
world_locations
].freeze
FILTERABLE_TIMESTAMP_FIELDS = %w[public_timestamp].freeze

include FilterExpressionHelpers
Expand Down
1 change: 1 addition & 0 deletions app/services/discovery_engine/query/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def initialize(
end

def result_set
Rails.logger.debug { "#{self.class.name}: Query: #{discovery_engine_params}" }
response = client.search(discovery_engine_params).response

ResultSet.new(
Expand Down

0 comments on commit a9a4442

Please sign in to comment.