# 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 1. `hook_views_pre_render()` reads the search term (from Advanced Search's `a[N][v]` parameters, or a plain Search API fulltext filter) and appends `?search_api_fulltext=` to the "Link this field to its item" links in the `solr_search_content` view. 2. `hook_preprocess_mirador()` reads that parameter and sets `windows[0].defaultSearchQuery` on 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.