Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add is_historic and government_name to fields requested from search #1198

Merged
merged 1 commit into from Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/lib/search_query_builder.rb
Expand Up @@ -83,6 +83,8 @@ def base_return_fields
content_purpose_supergroup
content_store_document_type
format
is_historic
government_name
)
end

Expand Down
1 change: 1 addition & 0 deletions features/step_definitions/advanced_search_steps.rb
Expand Up @@ -24,6 +24,7 @@ def finder_content_item
"fields" => %w(
title link description public_timestamp popularity
content_purpose_supergroup content_store_document_type format
is_historic government_name
organisations content_purpose_subgroup part_of_taxonomy_tree
).join(","),
"order" => "-public_timestamp",
Expand Down
2 changes: 2 additions & 0 deletions features/support/rummager_url_helper.rb
Expand Up @@ -98,6 +98,8 @@ def base_search_fields
content_purpose_supergroup
content_store_document_type
format
is_historic
government_name
)
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/finders_controller_spec.rb
Expand Up @@ -60,7 +60,7 @@
.with(
query: {
count: 10,
fields: "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,walk_type,place_of_origin,date_of_introduction,creator",
fields: "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,is_historic,government_name,walk_type,place_of_origin,date_of_introduction,creator",
filter_document_type: "mosw_report",
order: "-public_timestamp",
start: 0
Expand Down Expand Up @@ -118,7 +118,7 @@
.with(
query: {
count: 10,
fields: "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,walk_type,place_of_origin,date_of_introduction,creator",
fields: "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,is_historic,government_name,walk_type,place_of_origin,date_of_introduction,creator",
filter_document_type: "mosw_report",
order: "-public_timestamp",
start: 0
Expand Down Expand Up @@ -219,7 +219,7 @@
.with(
query: {
count: 10,
fields: "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,walk_type,place_of_origin,date_of_introduction,creator",
fields: "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,is_historic,government_name,walk_type,place_of_origin,date_of_introduction,creator",
filter_document_type: "mosw_report",
order: "-public_timestamp",
start: 0
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/search_query_builder_spec.rb
Expand Up @@ -59,7 +59,7 @@
context "without any facets" do
it "should include base return fields" do
expect(query).to include(
"fields" => "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format",
"fields" => "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,is_historic,government_name",
)
end
end
Expand All @@ -86,7 +86,7 @@

it "should include base and extra return fields" do
expect(query).to include(
"fields" => "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,alpha,beta",
"fields" => "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,is_historic,government_name,alpha,beta",
)
end

Expand All @@ -103,7 +103,7 @@

it "should use the filter value in fields" do
expect(query).to include(
"fields" => "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,zeta,beta",
"fields" => "title,link,description,public_timestamp,popularity,content_purpose_supergroup,content_store_document_type,format,is_historic,government_name,zeta,beta",
)
end
end
Expand Down