2. Basic and Advanced Search - digitalutsc/islandora_lite_docs GitHub Wiki

Introduction

Although Drupal’s Search API permits multiple back-ends, we use Solr and Drupal’s Apache Solr project, as well as the Advanced Search module, to offer a default, configurable, simple search as well as an advanced Boolean search.

Simple and Advanced Search

Module to install: https://github.com/digitalutsc/advanced_search/tree/dsu_utsc

We have extended the Islandora Advanced Search module to work with Drupal/Solr instances of Islandora and have added an "all" field that supports a DisMax search. This enables us to have a "simple search" box for google-style searching across a site.

Simple search

  • Go to Structure > Block Layout > (any region) > Place block
  • Look for Search block (screenshot below)
Screen Shot 2022-06-15 at 12 43 54 PM
  • Set config for the Simple Search block (screenshot below)
image

Advanced Search

Configure solr core to index fields as case insensitive fields

Note: For this be effective on search, field need to be set to String instead of Fulltext

  • Define the following field type in schema_extra_types.xml.
    • In ISLE-DC, it's located at /opt/solr/server/solr/ISLANDORA/conf
    • In Islandora Playbook, it's located at /var/solr/data/ISLANDORA/conf
<fieldType name="string_case_insensitive" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

  • Add the following copy fields schema_extra_fields.xml
<dynamicField name="tm_lowercase_*" type="string_case_insensitive" indexed="true" stored="true" multiValued="true"/>                                           
<copyField source="ss_*" dest="tm_lowercase_*" maxChars="30000" />                                                                                             
<copyField source="sm_*" dest="tm_lowercase_*" maxChars="30000" />     
  • Restart the Solr server

We have extended the following features:

How to enable it

  • Go to /admin/config/search/advanced, check Enable Lucene Search. checkbox

Screen Shot 2022-06-16 at 11 47 58 AM

Outcome
  • The Keyword option will be added to Advanced Search form.
Screen Shot 2022-06-16 at 11 49 14 AM * With this, the keyword will searched (with the above extended features) through all indexed field in `/admin/config/search/search-api/index/{{ Name of Solr indexer }}/fields`

Search-enabled automatic visualizations (integrations with Solr)

Map view

This view is the Leaflet map representation(https://leafletjs.com/) of digital objects which have coordinates in their metadata. The view uses Solr Indexer, and it can be searchable and works with facets.

Use:

Timeline View

This view is the timeline representation(https://timeline.knightlab.com/) of digital objects which have coordinates in their metadata. The view uses Solr Indexer, and it can be searchable and works with facets.

Use:

Research: Supporting a Calendar of repository items

See issue: https://github.com/digitalutsc/islandora_lite_solr_search/issues/3

Indexing WebVTT

Islandora Lite uses Ableplayer to provide accessible video/audio viewers, and to handle close caption and transcription. It stores the webvtt file via a custom media called Able Player Caption. To index the vtt files, we are using the file_extractor module. The module is configured to use the Search API Solr Extractor. It will add a computed field called "File extractor: extracted file". Navigate to that field in the search api field configurations, and add that to the index.

⚠️ **GitHub.com Fallback** ⚠️