Field Settings for Display, Search, Sort, and Facets

There are a number of places in the application stack that impact how fields are indexed for displaying, searching, sorting, and faceting and how the public interface makes use of these fields. This document will outline the connections between fields in the DDR, how fields get indexed in Solr, and what needs to be configured in DDR-public to use the fields.

Metadata Fields and the DDR Application Stack

DUL-Hydra – Staff Admin Application

Any of the descriptive metadata fields available in DUL-Hydra under DC Terms or Duke Terms may be used when adding metadata to the repository.

Without any further configuration in DDR-Models these fields will be indexed by Solr as "stored_searchable." This means that by default fields are available in Solr to be used in the public interface for both searching and display. Further configuration of DDR-Public is needed to display and/or search these fields.

DDR-Models – Hydra and ActiveRecord Models

Changes in DDR-Models are required if a field needs to be indexed for purposes other than searching and display.

Field constants and the Solr field type are defined in lib/ddr/index/fields.rb.

The source field to be indexed is defined in lib/ddr/models/indexing.rb.

Changes to DDR-Models requires that DUL-Hydra and DDR-Public be updated to use the updated version of DDR-Models. Changes to Solr Indexing settings in DDR-Models requires reindexing of affected collections already in the repository.

Faceting

For a field to be facet-able it must be stored in an un-tokenized field in Solr. A field will be indexed this way if it is defined as "facetable" or "stored_sortable" in DDR-Models.

Sorting

If a field will be used for sorting results then it must be configured in DDR-Models to be indexed by Solr as "sortable" or "stored_sortable."


DDR-Public – Public Interface to the DDR

There are several places in the public application where Solr fields are configured to enable display, searching and faceting.


Searching

To be searched by DDR-Public a field must be configured in the application in the "all_fields" add_search_field configuration block in the CatalogController.

Example that would enable searching the title, creator, and contributor fields:


config.add_search_field 'all_fields', :label => 'All Fields' do |field|
field.solr_local_parameters = {
:qf => ["id",
solr_name(:title, :stored_searchable),
solr_name(:creator, :stored_searchable),
solr_name(:contributor, :stored_searchable).join(' ')
}
end

Changes to search fields in ddr-public require a new release and deployment of the application.

Display

In the public application metadata can be configured to display in search results (index view) and item records (show view). This is configurable by collection in DDR-Portals. Additionally, fields set for display in the index and show views may be optionally set to be browse-able links if a facetable field is available, such as in the example below.

For example, for contributor to display and be browse-able from a Benjamin Rush item's show view you would need to add the following lines to the collection's configuration file.

configure_blacklight: 
  add_show_field:
- field:
- :contributor
- :stored_searchable
separator: "; "
label: "Recipient"
link_to_search: "Ddr::Index::Fields::CONTRIBUTOR_FACET"

Changes to display fields require updating the version of DDR-Portals on production and reloading Apache.


Faceting

To appear as a facet in the public application, fields must be configured in DDR-Portals.

For example, for contributor to appear as a facet for the Benjamin Rush collection you would need to add the following lines to the collection's configuration file.

configure_blacklight:
add_facet_field:
- field: "Ddr::Index::Fields::CONTRIBUTOR_FACET"
label: Recipient
show: true


Changes to facets require updating the version of DDR-Portals on production and reloading Apache.

Sorting

To be used for sorting search results in DDR-Public a sortable field must be configured in Blacklight in the CatalogController.

Example that would enable sorting on the date field from old to new:

config.add_sort_field "#{Ddr::Index::Fields::DATE_SORT} asc", :label => 'date (old to new)'


Changes to sort options in DDR-Public require a new release and deployment of the application.


Current Field Settings

DDR-Models

List of fields available for faceting and sorting.

Facet Fields – (See all fields defined in DDR-Models)

ADMIN_SET_FACET
BOX_NUMBER_FACET
CATEGORY_FACET
COLLECTION_FACET
COMPANY_FACET
CONTRIBUTOR_FACET
CREATOR_FACET
DATE_FACET
FORMAT_FACET
MEDIUM_FACET
PLACEMENT_COMPANY_FACET
PRODUCT_FACET
PUBLICATION_FACET
PUBLISHER_FACET
SERIES_FACET
SETTING_FACET
SPATIAL_FACET
SUBJECT_FACET
TONE_FACET
TYPE_FACET
YEAR_FACET


Sort Fields – (See all fields defined in DDR-Models)

ACCESS_ROLE
ACTIVE_FEDORA_MODEL
ADMIN_SET
ASPACE_ID
ATTACHED_FILES
CONTENT_CREATE_DATE
DEPOSITOR
DISPLAY_FORMAT
EAD_ID
FCREPO3_PID
IS_LOCKED
LAST_FIXITY_CHECK_ON
LAST_VIRUS_CHECK_ON
LICENSE
LOCAL_ID
MULTIRES_IMAGE_FILE_PATH
OBJECT_STATE
OBJECT_CREATE_DATE
OBJECT_MODIFIED_DATE
ORIGINAL_FILENAME
PERMANENT_ID
PERMANENT_URL
RESEARCH_HELP_CONTACT
TECHMD_FITS_VERSION
TECHMD_FITS_DATETIME
TECHMD_MD5CHECKSUM
TITLE
WORKFLOW_STATE

DDR-Public

List of fields configured for searching and sorting.

Search Fields – (Configuration in DDR-Public)

id
solr_name(:abstract, :stored_searchable)
solr_name(:category, :stored_searchable)
solr_name(:company, :stored_searchable)
solr_name(:creator, :stored_searchable)
solr_name(:contributor, :stored_searchable)
solr_name(:description, :stored_searchable)
solr_name(:format, :stored_searchable)
solr_name(:identifier, :stored_searchable)
solr_name(:medium, :stored_searchable)
solr_name(:placement_company, :stored_searchable)
solr_name(:product, :stored_searchable)
solr_name(:publication, :stored_searchable)
solr_name(:publisher, :stored_searchable)
solr_name(:series, :stored_searchable)
solr_name(:setting, :stored_searchable)
solr_name(:spatial, :stored_searchable)
solr_name(:subject, :stored_searchable)
solr_name(:title, :stored_searchable)
solr_name(:tone, :stored_searchable)
solr_name(:type, :stored_searchable)
Ddr::Index::Fields::ALL_TEXT
Ddr::Index::Fields::LOCAL_ID
Ddr::Index::Fields::PERMANENT_ID
Ddr::Index::Fields::YEAR_FACET

Sort Fields - (Configuration in DDR-Public)

config.add_sort_field "score desc, #{Ddr::Index::Fields::DATE_SORT} asc, title_tesi asc", :label => 'relevance'
config.add_sort_field "#{Ddr::Index::Fields::TITLE} asc", :label => 'title'
config.add_sort_field "#{Ddr::Index::Fields::DATE_SORT} asc", :label => 'date (old to new)'
config.add_sort_field "#{Ddr::Index::Fields::DATE_SORT} desc", :label => 'date (new to old)'