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

Update collection_search.md #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
18 changes: 11 additions & 7 deletions recipes/collection_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@

How do I search only a certain collection or a collection and all sub-collections?

This functionality is provided in the Islandora Starter Site, with some nice UI sugar provided by the [Advanced Search module](https://www.drupal.org/project/advanced_search). If you want to configure collection search without that module, this recipe provides a way.

## Ingredients

* Drupal 8
* Islandora
* Islandora Defaults (for some expected settings)
* Drupal 10
* Solr
* A collection field, such as "Member of" (`field_member_of`)

## Instructions

### Creating shallow search

This is a simple view following the `member_of` relationship, though it could follow any parent child relationship.
This is a simple view following the `member_of` relationship, though it could follow any parent-child relationship.

#### Creating required search fields
#### Creating an aggregated search field

To create the search fields go to **Admin -> Configuration -> Search and Metadata -> Search API**
We need to create a field in Solr that the search view will use to search on. It should combine all the fields in the content that you want to be searchable (This is not necessary if using the Advanced Search module). Alternately, you could skip this step and use the "Rendered Entity" Solr field, if you have entities rendered in a way that displays all the desired fields.

To create the search field go to **Admin -> Configuration -> Search and Metadata -> Search API**

![Search API screenshot](./screenshots/collection_search/search_api.png)

Then choose **Edit** operation on the _Index (Default Solr content index)_ line.
Then select your Index, here called _Index (Default Solr content index)_.

Then choose the **Fields** tab.

Expand Down