Skip to content

Commit

Permalink
Merge pull request #1410 from alphagov/fix-filter-query
Browse files Browse the repository at this point in the history
Fix filter query by splitting it
  • Loading branch information
kentsanggds authored Jan 17, 2025
2 parents 8006bd1 + 98f8972 commit 022c2e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/search/solr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def self.build_filter_query(params)
format_param = params.dig(:filters, :format)
licence_param = params.dig(:filters, :licence_code)

filter_query = ["state:active"]
filter_query = ["state:active", "type:dataset"]
filter_query << publisher_filter(publisher_param) if publisher_param.present?
filter_query << topic_filter(topic_param) if topic_param.present?
filter_query << format_filter(format_param) if format_param.present?
Expand Down
2 changes: 1 addition & 1 deletion spec/services/search/solr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
it "includes active datasets filter" do
filter_query = described_class.build_filter_query({ filters: {} })

expect(filter_query).to eq(["state:active"])
expect(filter_query).to eq(["state:active", "type:dataset"])
end
end

Expand Down

0 comments on commit 022c2e2

Please sign in to comment.