Skip to content

Commit

Permalink
Merge pull request #18 from Islandora-Labs/rosiel-patch-1
Browse files Browse the repository at this point in the history
Update collection_search.md
  • Loading branch information
aOelschlager authored Jan 8, 2025
2 parents b35bf4d + bf28857 commit 7f29118
Showing 1 changed file with 11 additions and 7 deletions.
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

0 comments on commit 7f29118

Please sign in to comment.