Skip to content

Commit

Permalink
index range label, but exclude from display by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tampakis committed Nov 30, 2018
1 parent a9b5fd3 commit 42673bd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
/tmp
/coverage/*
/public/uploads

.byebug_history
3 changes: 2 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def search_across_settings
end

def unique_custom_fields
Spotlight::CustomField.select(:field, :configuration).distinct.to_a.uniq(&:field)
Spotlight::CustomField.select(:field, :configuration).distinct.to_a
.uniq(&:field).reject { |v| v.field == 'readonly_range-label_ssim' }
end

configure_blacklight do |config|
Expand Down
4 changes: 1 addition & 3 deletions app/values/manifest_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def manifest_fields
def range_labels(h)
values = []
(@manifest['structures'] || []).each do |s|
(s['ranges'] || []).each do |r|
values << r['label']
end
values << s['label']
end
h['Range label'] = values unless values.empty?
end
Expand Down
7 changes: 7 additions & 0 deletions spec/fixtures/iiif_responses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ def test_manifest1
}
]
}
],
"structures": [
{
"@type": "sc:Range",
"label": "range label value",
"ranges": []
}
]
}.to_json
end
Expand Down
5 changes: 5 additions & 0 deletions spec/services/iiif_manifest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,10 @@
expect(manifest_service.to_solr["sort_author_ssi"]).to eq "John Doe"
end
end
describe 'range-label' do
it 'is a multi-value text field' do
expect(manifest_service.to_solr["readonly_range-label_tesim"]).to eq ["range label value"]
end
end
end
end

0 comments on commit 42673bd

Please sign in to comment.