# Islandora Advanced Search - [Introduction](#introduction) - [Feature and Advantages](#features-and-advantages) - [Requirements](#requirements) - [Installation](#installation) - [Configuration](#configuration) - [Configuring Solr](#configuring-solr) - [eDismax Search](#edismax-search) - [Configure Collection Search](#configure-collection-search) - [Configure Views](#configure-views) - [Exposed Form](#exposed-form) - [Collection Search](#collection-search) - [Paging](#paging) - [Sorting](#sorting) - [Search Highlighting](#search-highlighting) - [Result Summary](#result-summary) - [Configure Blocks](#configure-blocks) - [Advanced Search Block](#advanced-search-block) - [Search Block (NEW)](#search-block-new) - [Documentation](#documentation) - [Troubleshooting/Issues](#troubleshootingissues) - [Maintainers](#maintainers) - [Sponsors](#sponsors) - [Development](#development) - [License](#license) ## Introduction The Advanced Search module provides keyword search, field search, boolean search, and search within collections and sub collections. It provides a pager UI component that allows the user to set the number of items to show, select sort criteria and display style (grid or list). It provides a global search block, which redirects the search query to a search page. It also enables the use of Ajax with views (powered by Solr), search blocks, facets, and search results.  ## Features and Advantages The module provides Boolean search, enables you to use AND, OR or NOT options to helps expanding or narrowing your search parameters.
|
Standard Query Parser |
The Extended DisMax (eDismax) Query Parser |
|
|
Use |
If Edimax is turned off in configuration, the “Standard Query Parser” is used. |
Edismax is enabled by default, but can be turned off in configuration (/admin/config/search/advanced). |
|
Capacity |
|
|
|
Search |
Content indexed into a string field
Content indexed into a full-text field
|
Content indexed into a string field
Content indexed into a full-text field
|
|
Operator |
Usage |
Example |
|
AND |
Narrow down your search to include results that contain both search terms |
orientation AND games |
|
OR |
Broaden your search to include results that contain either search term |
students OR undergraduates |
|
NOT |
Narrow your search by excluding certain words or phrases |
orientation NOT games |
|
Asterisk (*) |
Replaces the asterisk with multiple characters. Use to search for multiple beginnings, middles, and endings of words. |
librar* will include results like:
|
|
Question Mark (?) |
Replaces the question mark with a single character. Use to search for multiple beginnings, middles, and endings of words. |
?est will include results like:
Will not include:
|
|
Tilde (~) |
Use to make your search ‘fuzzy’ or search for synonyms and alternate spellings. Only works for Keyword search. |
Shaun~ will include results like:
|
|
Quotation Marks (“”) |
Use quotation marks to search for a specific word or phrase. |
“alumni golf tournament” |
## Requirements Use composer to download the required libraries and modules. ```bash composer require drupal/facets "^1.3" composer require drupal/search_api_solr "^4.1" composer require drupal/search_api "^1.5" ``` However, for reference, `advanced_search` requires the following drupal modules: - [facets](https://www.drupal.org/project/facets) - [search_api_solr](https://www.drupal.org/project/search_api_solr) ## Installation To download/enable just this module, use the following from the command line: ```bash composer require islandora/islandora drush en advanced_search ``` ## Configuration You can set the following configuration at `admin/config/islandora/advanced_search`:  ## Configuring Solr Please review [Islandora Documentation](https://islandora.github.io/documentation/user-documentation/searching/) before continuing. The following assumes you already have a working Solr and the Drupal Search API setup. ## eDismax Search Click [here](https://www.drupal.org/docs/contributed-modules/search-api-solr/solr-query-parsers) to find more detail about eDismax Search in Drupal.  ## Configure Collection Search To support collection based searches you need to index the `field_member_of` for every repository item as well define a new field that captures the full hierarchy of `field_member_of` for each repository item. Add a new `Content` solr field `field_decedent_of` to the solr index at `admin/config/search/search-api/index/default_solr_index/fields`.  Then under `admin/config/search/search-api/index/default_solr_index/processors` enable `Index hierarchy` and setup the new field to index the hierarchy.   The field can now be used limit a search to all the decedents of a given object. > N.B. You may have to re-index to make sure the field is populated. ## Configure Views The configuration of views is outside of the scope of this document, please read the [Drupal Documentation](https://www.drupal.org/docs/8/core/modules/views), as well as the [Search API Documentation](https://www.drupal.org/docs/contributed-modules/search-api). ### Exposed Form Solr views allow the user to configure an exposed form (_optionally as a block_). This form / block is **different** from the [Advanced Search Block](#advanced-search-block). This module does not make any changes to the form, but this form can cause the Advanced Search Block to not function if configured incorrectly. The Advanced Search Block requires that if present the Exposed forms `Exposed form style` is set to `Basic` rather than `Input Required`. As `Input Required` will prevent any search from occurring unless the user puts an additional query in the Exposed form as well.  ### Collection Search That being said it will be typical that you require the following `Relationships` and `Contextual Filters` when setting up a search view to enable `Collection Search` searches.  Here a relationship is setup with `Member Of` field and we have **two** contextual filters: 1. `field_member_of` (Direct decedents of the Entity) 2. `field_decedent_of` (All decedents of the Entity) Both of these filters are configured the exact same way.  These filters are toggled by the Advanced Search block to allow the search to include all decedents or just direct decedents (*documented below*). ### Paging The paging options specified here can have an affect on the pager block (*documented below*).  ### Sorting Additional the fields listed as `Sort Criteria` as `Exposed` will be made available in the pager block (*documented below*).  ### Search Highlighting 1. Add Search Excerpt to the Advanced Search View. - Navigate to `/admin/structure/views/view/advanced_search`. In the `Fields` section, click `Add`, then select `Search Excerpt`.'  2. Turn on Search API highlight processor - Navigate to `/admin/config/search/search-api` > Edit Index > Processors > Enable Highlight processor.  - At the bottom of the form, under Processor Settings > Highlight > Select `Create excerpt`.  3. Configure Solr Server. - Navigate to `/admin/config/search/search-api` > Edit Server > Configure Solr backend > Advanced > Select `Retrieve highlighted snippets`.  ### Result Summary In your view, in the `Header` section, clikc `Add`, then search and select for "Result summary".  Then, paste the following code to `Display` textarea in `Configure Header: Global: Result summary` ````