Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial search configuration documentation #1050

Merged
merged 5 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/search-settings-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions docs/user-documentation/searching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Setup and Configure Search

Islandora 8 comes with the Drupal 8 [Search API](https://www.drupal.org/project/search_api) and [SOLR](https://www.drupal.org/project/search_api_solr) modules enabled with a corresponding SOLR instance. This guide gives an overview to the setup provided by the claw-playbook. Much more detail is available in the [Search API documentation](https://www.drupal.org/docs/8/modules/search-api). Another helpful resource is [Adam Fuch's "Drupal 8 Custom Site Search with Search API"](https://www.electriccitizen.com/blog/drupal-8-custom-site-search-search-api) (https://www.electriccitizen.com, 2018-01-10; last accessed 2019-03-08).

## Indexing Islandora 8 with SOLR

To access the search indexing settings navigate to '/admin/config/search/search-api'.

![Screenshot of the search-api configuration page.](../assets/search-settings-page.png)

### SOLR Server Configuration

Use the 'Solr Server' link to view the SOLR server's configuration and the 'Default Solr content index' link to view or update the index settings. In most cases, where the site was built using ansible, the 'Solr Server' settings that were configured during installation should be left alone.

### SOLR Index Configuration

The Default Solr content index user interface is divided into four tabs: 'View', 'Edit', 'Fields', and 'Processors'.

#### View Tab

The 'View' tab gives an overview of the index and its status:
- 'Index status' is a progress bar that indicates how many items have been indexed.
- 'Status' allows you to enable/disable the index from being used.
- 'Datasource' indicates what types of entities are being indexed and how many have.
- 'Tracker' states which item tracker is being used.
- 'Server' provides a link to the SOLR server's configuration page.
- 'Server index status' is a count of the total number of items returned from an unfiltered empty search. Generally speaking, this should match the total number of items indexed. See the [Drupal 7 Search API FAQ](https://www.drupal.org/node/2009804#server-index-status) for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the link say Drupal 8 search api FAQ? Or is that the old documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that link was for the Drupal 7 Search API (which is were I found out about it); but I see that this FAQ was pulled over into the Drupal 8 documentation, so I will update the link.

- 'Cron batch size' displays how many items will be indexed when Drupal's cron runs.

The 'View' tab also provides links to some common actions. 'Start Indexing Now' allows you to start a indexing job for a specified number of items (default is 'all'). You can also specify how many items should be indexed in each batch (default is '50'). The other links allow a repository manager to queue all objects for reindexing, clear the index, or rebuild tracking information.

#### Edit Tab

The 'Edit' tab allows repository managers to configure how the index works as a whole, including its name, the data sources—entity types—it can index (including which specific content types or taxonomies will be indexed), which server it is connected to, and other SOLR-specific options.
seth-shaw-unlv marked this conversation as resolved.
Show resolved Hide resolved

'Content' (types) is the only data source enabled by default. Selecting 'Taxonomy term' will enable searching taxonomies which is recommended if the repository uses taxonomies for subjects or other discovery points. Once the data sources are enabled a configuration box for each of them will appear in a section just below the list of data sources. This allows repository managers to select which content types (or taxonomy vocabularies) will be included in the index. By default all the content types, and vocabularies if the taxonomy data source is enabled, are indexed.

**Note:** the defaults assume a repository is adding content using the web interface. If a repository manager plans on bulk-loading content they should disable the 'Index items immediately' option in the expandable 'Index Options' box and increase the 'Cron batch size' option.

#### Fields Tab

The 'Fields' tab allows repository managers to select which fields will be indexed. The default set of fields enabled come from a standard Drupal installation and do not reflect the fields Islandora adds for 'Repository Item'. **Repository managers need to add the fields necessary for their Islandora instance.**
seth-shaw-unlv marked this conversation as resolved.
Show resolved Hide resolved

To add a field, click the '+ Add fields' button. A shadow-box will appear with a list of the fields available for the index.

Some fields, such as the 'Body' ('body') field provided by Drupal, have multiple subfields which can be completely different values or variations on the same value. Click on the plus-sign next to the field to show the available subfields. In most cases repository managers can click the 'Add' button by the field and ignore the subfields as it will index the field as it is rendered to users. Only select the subfields if you understand the field's type, the value returned by the subfield, and how it will impact user searching. Similar to the complex fields, entity reference fields, such as Tags ('field_tags'), allow you to select fields from the referenced entity to index.

Once the fields are added they can be configured further on the 'Fields' tab, although the label, machine name, and type usually don't need to be changed. The 'Type' setting has several different types of Full-text processing available, which may be of interest. Each is described in the expandable 'Data Types' box at the bottom of the page. The 'Boost' setting allows repository managers to increase the weight of particular fields when calculating search relevancy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change: The 'Type' dropdown has several different options of Full-text processing available which may be of interest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be positive to speak about field properties and not subfields. There is not such a think of a subfield in drupal 8. Fields can have many properties, some exposed and indexable other not (search api limitations) and even the default, visible and renderable value is a property, the a default one (->value).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DiegoPino, right. I was using my internal conceptualization of Fields (when I was trying to figure out how they worked) rather than the Drupal terminology. I'll fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DiegoPino, I've updated this part. Let me know what you think.


#### Processors Tab

The 'Processors' tab allows repository managers to adjust how data and search queries are processed to adjust results. The defaults are acceptable in most cases.

## Searching Islandora 8

The Search API SOLR module comes with a search page pre-configured (accessible at '/solr-search/content'). To edit the search page, navigate to '/admin/structure/views/view/solr_search_content'.

Repository managers may want to change the URL used to access the page, add it to the site navigation, or add a search box. In the 'Page Settings' box in the middle of the page, click on the existing path to open a shadow-box with an edit field. Change the URL as desired, for example, to 'search' and click 'Apply'. Then, click the 'No menu' link just below it to open the menu settings shadow-box. Selecting 'Normal menu entry' will allow a repository manager to add a menu link text, description, and place it within the site menu tree (the default, `<Main navigation>` works for most sites). A search box can be added by expanding the 'Advanced' options and changing the 'Exposed form in block' setting and then use the 'Block Layout' interface to place the block where desired. After making changes to the View's settings, click the 'Save' button to ensure the changes are not lost.
seth-shaw-unlv marked this conversation as resolved.
Show resolved Hide resolved

Islandora's Repository Items are displayed in the search results as a fully rendered entity by default. Repository managers can choose which view mode should be used for each search datasource by clicking the 'Settings' link next to the 'Show:' setting under the 'Format' section of the search view configuration page. The 'Teaser' and 'Search result highlighting input' are the two most likely options. Alternatively, repository managers can select specific fields to display instead by clicking the 'Rendered Entity' link and changing it to 'Fields' and then choosing which fields will be displayed in the 'Fields' section underneath. **Note:** thumbnails will not immediately be available using this method without more advanced configurations.
seth-shaw-unlv marked this conversation as resolved.
Show resolved Hide resolved
Empty file removed docs/user-documentation/solr.md
Empty file.