This module adds two Drupal form API elements and a menu path used for autocompletion used for autocompletion on one of them. These two new elements are:
islandora_authority_textfield
: A textfield which can autocomplete on a Solr field.islandora_authority_hidden
: A hidden element which can be autocompleted, as a result of a search.
One caveat: Due to how we perform lookups, forms in which these elements must pass through Objective Forms to recieve #hash
values.
This module requires the following modules/libraries:
Install as usual, see this for further information.
Our configuration is stored in #user_data
on our islandora_authority_textfield
and islandora_authority_hidden
elements.
Generally, multiple islandora_authority
elements are direct children of a common parent. The framework defines a single parameter on the parent:
islandora_authority_controller
: A machine name indicating the controller to use. Defaults tosolr
if otherwise unspecified.
Machine name: solr
This controller is attempted if no other is specified.
The Solr controller defines two parameters on the parent element:
islandora_authority_t_pattern
: A pattern as used by Drupal'sformat_string()
/t()
function.islandora_authority_fq
: A list of tilde-separated Lucene statements, e.g.:PID:ir*
, to ensure all results come from the IR namespace. (Note: separating is done via a naive explode; tildes in values break it)
Each contained authority element specifies:
islandora_authority_solr_search_field
: Should be an EdgeNGram'd Solr field.islandora_authority_solr_validate_field
: An optional Solr field to validate the contents of the element against. This does not prevent the form from being saved; it simply provides visual feedback on form load and element change for whether the field contains an authorized value. This should be an untokenized Solr field.islandora_authority_solr_display_field
: An optional Solr field, used for display purposes (defaults to the search field).islandora_authority_mapping
: An optional placeholder, which will make values for this field available for substitution into thet_pattern
above.islandora_authority_search_without_dismax
: A flag which should be set (to "true") whenislandora_authority_solr_search_field
is not an EdgeNGram'd Solr field, so queries will be made as (non-dismax) prefix queries instead of depending on the behaviour of EdgeNGrams. Note that EdgeNGrams are more predicatable in the results they return; prefix/wildcard queries skip analysis, so indexing analysis can result in false-negatives.
Having problems or solved a problem? Contact discoverygarden.
Current maintainers:
If you would like to contribute to this module, please check out our helpful Documentation for Developers info, as well as our Developers section on the Islandora.ca site.