Skip to content

Commit

Permalink
Merge pull request #69 from alphagov/assorted-fields
Browse files Browse the repository at this point in the history
Add AAIB-related additional searchable text
  • Loading branch information
csutter authored Oct 26, 2023
2 parents f2de0a6 + dcf6c07 commit fa7e142
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/document_sync_worker/document/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Publish < Base
$.details.hidden_search_terms
$.details.metadata.hidden_indexable_content
$.details.metadata.project_code
$.details.metadata.aircraft_type
$.details.metadata.registration
$.details.acronym
$.details.attachments[*]['title','isbn','unique_reference','command_paper_number','hoc_paper_number']
].map { JsonPath.new(_1) }.freeze
Expand Down
15 changes: 15 additions & 0 deletions spec/lib/document_sync_worker/document/publish_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,21 @@
it { is_expected.to eq("LOL") }
end

describe "with a registration and aircraft type" do
let(:document_hash) do
{
"details" => {
"metadata" => {
"registration" => "G-CIVY",
"aircraft_type" => "Boeing 747-436",
},
},
}
end

it { is_expected.to eq("Boeing 747-436\nG-CIVY") }
end

describe "with attachments" do
let(:document_hash) do
{
Expand Down

0 comments on commit fa7e142

Please sign in to comment.