Skip to content

Commit eebdd76

Browse files
Merge pull request #1614 from projectblacklight/backport-1613
Index names on components so search works as expected (#1613)
2 parents ed2c739 + 4346de0 commit eebdd76

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

lib/arclight/traject/ead2_component_config.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268

269269
NAME_ELEMENTS.map do |selector|
270270
to_field 'names_ssim', extract_xpath("./controlaccess/#{selector}"), unique
271+
to_field 'names_ssim', extract_xpath(".//#{selector}"), unique
271272
to_field "#{selector}_ssim", extract_xpath(".//#{selector}")
272273
end
273274

spec/features/fielded_search_results_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787
it '#name' do
8888
visit search_catalog_path q: 'root', search_field: 'name'
8989
within('.document-position-1') do
90+
expect(page).to have_css '.index_title', text: /Dr. Root and L. Raymond Higgins/
91+
end
92+
93+
within('.document-position-2') do
9094
expect(page).to have_css '.index_title', text: /Alpha Omega Alpha Archives/
9195
end
9296
end

spec/features/highlighted_search_results_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
visit search_catalog_path q: 'william root', search_field: 'name'
3030
within '.document-position-1' do
3131
within '.al-document-highlight' do
32-
expect(page).to have_css 'em', text: 'William', count: 3
33-
expect(page).to have_css 'em', text: 'Root', count: 3
32+
expect(page).to have_css 'em', text: 'William', count: 1
33+
expect(page).to have_css 'em', text: 'Root', count: 2
3434
end
3535
end
3636
end

spec/features/traject/ead2_indexing_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ def components(result)
176176
)
177177
end
178178

179+
it 'names' do
180+
expect(first_component['names_ssim']).to include 'Stanford, Leland'
181+
end
182+
179183
it 'geogname' do
180184
%w[geogname_ssim geogname_ssm].each do |field|
181185
expect(all_components.first[field]).to be_nil

spec/fixtures/ead/sul-spec/a0011.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@
177177
<container id="aspace_76137544d2e63550e7a7ef7cf2168c48"
178178
label="Mixed Materials" type="box">1
179179
</container>
180+
<origination label="Creator">
181+
<persname rules="aacr" source="naf">Stanford, Leland</persname>
182+
</origination>
180183
</did>
181184
</c01>
182185
</dsc>

0 commit comments

Comments
 (0)