Displaying the collection name in search results

90 views
Skip to first unread message

Mark Jordan

unread,
Jul 8, 2016, 1:15:34 PM7/8/16
to islandora, islandora-dev
Hi,

We're getting some demand to display the collection(s) an object is a member of in search results. I know it is easy to add the collection as a facet (and we're doing that) but it seems our users (or at least the ones who complain enough) don't really understand facets.

Does anyone else have this use case? We (Simon Fraser) could probably solve locally (i.e., quickly) in the theming layer but if there is general interest in this, I could open a JIRA ticket proposing to refactor the code starting at https://github.com/Islandora/islandora_solr_search/blob/7.x/includes/results.inc#L931 out to a function so that it could also be applied to search result entries, not just facets.

Alternatively, if there are other approaches to rendering a human-readable label for collections in search results, I'd be happy to not do the work described above.

Mark

Rosemary Le Faive

unread,
Jul 9, 2016, 10:33:52 AM7/9/16
to islandora, island...@googlegroups.com
We edited our gsearch transform so that it indexes the collection name as well as the "info:fedora/..." uri. I think it's something along the lines of this (the magic being where they define the collectionContent variable). 

Brad Spry

unread,
Jul 11, 2016, 8:22:51 PM7/11/16
to islandora, island...@googlegroups.com
Mark,

Our metadata librarians encode the parent collection name in MODS metadata using <relatedItem>

<relatedItem type="host">
<titleInfo>
<title>Bryant McMurray motorsports photographs</title>
</titleInfo>
</relatedItem>

"host – Use this value to describe a host or parent resource, for example a book in which an article appears or a collection in which an item belongs."
https://www.loc.gov/standards/mods/userguide/relateditem.html

Then the metadata value could be used as a display field:
mods_relatedItem_host_titleInfo_title_ms


Brad

Mark Jordan

unread,
Jul 12, 2016, 10:59:36 AM7/12/16
to isla...@googlegroups.com, island...@googlegroups.com
Thanks to everyone who replied. I've implemented a small module, Islandora Metadata Extras, to provide a configuration option to show the collection label in search results. The solution I've chosen in Extras implements a single hook to alter each search result on the fly and doesn't interact with the code I cited in my original message, so using it is completely optional. While I appreciate the approaches that store the collection label as a Solr field, I want to avoid having to reindex our Islandora instances if possible.

As I say in the module's README, I'm probably going to consolidate a couple other small modules I've developed to tweak metadata display (Empty Metadata Values, Compound Parent Metadata) into this one, so that we can manage the options in a single place and reduce the number of installed modules.

Once I do a bit more work on the Islandora Metadata Extras module I'll add it to the Awesome list.

Mark


--
For more information about using this group, please read our Listserv Guidelines: http://islandora.ca/content/welcome-islandora-listserv
---
You received this message because you are subscribed to the Google Groups "islandora" group.
To unsubscribe from this group and stop receiving emails from it, send an email to islandora+...@googlegroups.com.
Visit this group at https://groups.google.com/group/islandora.
To view this discussion on the web visit https://groups.google.com/d/msgid/islandora/88c5a5ee-f17c-4d20-b83f-357ec742e676%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ian Stewart

unread,
Aug 20, 2018, 1:02:11 PM8/20/18
to islandora
Hi Mark, all 

Is there any easy way to use this approach to get the collection name to appear in facets too? I can add ds.mods as a facet at present, but that seems to facet every word of the ds.mods field rather than the overall field content. 

Brandon Weigel

unread,
Aug 20, 2018, 1:06:27 PM8/20/18
to islandora
No need for Metadata Extras for that, Ian. Configuring your Facets, choose RELS_EXT_isMemberOfCollection_uri_s. Configure it, give it a label, and select "Replace PID with Object Label". You'll get the collection title in the facets.
Reply all
Reply to author
Forward
0 new messages