Skip to content

Commit

Permalink
Merge pull request #66 from alphagov/additional-searchable
Browse files Browse the repository at this point in the history
Add `details.acronym` to additional searchable text
  • Loading branch information
csutter authored Oct 26, 2023
2 parents 45ff688 + c839e66 commit 7483627
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/document_sync_worker/document/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Publish < Base
$.details.hidden_search_terms
$.details.metadata.hidden_indexable_content
$.details.metadata.project_code
$.details.acronym
].map { JsonPath.new(_1) }.freeze
ADDITIONAL_SEARCHABLE_TEXT_VALUES_SEPARATOR = "\n".freeze

Expand Down
12 changes: 12 additions & 0 deletions spec/lib/document_sync_worker/document/publish_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@

it { is_expected.to eq("PRINCE2") }
end

describe "with an acronym" do
let(:document_hash) do
{
"details" => {
"acronym" => "LOL",
},
}
end

it { is_expected.to eq("LOL") }
end
end

describe "link" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/document_sync_worker_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
content_id: "6ba90ae6-972d-4d48-ad66-693bbb31496d",
title: "Legal Aid Agency",
description: "We provide civil and criminal legal aid and advice in England and Wales to help people deal with their legal problems. LAA is an executive agency, sponsored by the Ministry of Justice .",
additional_searchable_text: "",
additional_searchable_text: "LAA",
link: "/government/organisations/legal-aid-agency",
url: "http://www.dev.gov.uk/government/organisations/legal-aid-agency",
public_timestamp: 1_695_391_634,
Expand Down

0 comments on commit 7483627

Please sign in to comment.