Skip to content

Commit

Permalink
Merge pull request #743 from pulibrary/719-resource-adr
Browse files Browse the repository at this point in the history
Add ADR and comments for resource-per-collection decision
  • Loading branch information
escowles committed Feb 28, 2020
2 parents 04441c9 + fc59fd7 commit 977c59b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def unique_custom_fields
config.browse.document_actions = config.index.document_actions

## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
# Group records by manifest in order to display a single result for a given
# resource in 'search across'
config.default_solr_params = {
qt: 'search',
rows: 10,
Expand Down
2 changes: 2 additions & 0 deletions app/models/adjusted_grouped_response.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# After the grouping that happens during search, the facet counts are wrong. We
# adjust them to reflect actual counts for the result set.
class AdjustedGroupedResponse < Blacklight::Solr::Response
def initialize(*args)
data = FacetCount.new(args.first)
Expand Down
35 changes: 35 additions & 0 deletions architecture-decisions/0005-resource-per-collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 5. Create a IIIFResource for each Collection that a resource is a member of

Date: Archaeological

## Status

Accepted

## Context

We needed to be able to display a resource in more than one collection, because
in Figgy a resource can be a member of multiple collections.

At the time of this decision, one IIIFResource could only be a member of one Exhibit.

## Decision

We create one IIIFResource per Collection of which it is a member.

We map each IIIFResource to one SolrDocument.

## Consequences

* 'Search Across' requires a complicated grouping mechanism (in solr) in order
to keep a resource from appearing multiple times.

* It's easy to delete a collection and all its resources. It's easy to delete a
resource if it's no longer in a given collection.

* The resource that appears in 'Search Across' displays metadata as shown in the
exhibit it happened to pull the resource from. This may be be specialized to
the exhibit, and different from the canonical data as stored in figgy.

* If spotlight introduces the ability to have one resource in multiple exhibits
we may have a different implementation than is in core (this happened).

0 comments on commit 977c59b

Please sign in to comment.