You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
1 week ago | |
|---|---|---|
| README.md | 1 week ago | |
| composer.json | 1 week ago | |
| mirador_search_highlight.info.yml | 1 week ago | |
| mirador_search_highlight.module | 1 week ago | |
README.md
Mirador search highlight
When someone clicks an item from the Solr search results, Mirador opens with the search term already run against the item's IIIF content search service, so matches are highlighted with no extra JavaScript.
How it works
hook_views_pre_render()appends?search_api_fulltext=<term>to the "Link this field to its item" links in thesolr_search_contentview.hook_preprocess_mirador()reads that parameter and setswindows[0].defaultSearchQueryon the viewer's Mirador config.
The manifest must advertise a search service (search_endpoint in the
iiif_manifest view) for Mirador to run the search.
Configuration
Edit the constants at the top of mirador_search_highlight.module to change
the query parameter or the views whose links carry the term.
Only fields using Search API's "Link this field to its item" option get the term. Fields linked another way (for example an image formatter linking to content) are left alone.