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

Search within a collection #1275

Open
mjordan opened this issue Sep 16, 2019 · 21 comments
Open

Search within a collection #1275

mjordan opened this issue Sep 16, 2019 · 21 comments
Labels
Type: use case proposes a new feature or function for the software using user-first language.

Comments

@mjordan
Copy link
Contributor

mjordan commented Sep 16, 2019

Title (Goal) Search within a collection
Primary Actor End user
Scope Search
Story As a user I want to be able to search within a collection, like I can do in Islandora 7 using https://github.com/discoverygarden/islandora_collection_search.
@kayakr
Copy link
Contributor

kayakr commented Sep 17, 2019

@mjordan We are doing this via Collection as a facet. Does that suffice, or do you have something else in mind?

@mjordan
Copy link
Contributor Author

mjordan commented Sep 17, 2019

It suffices for me, but since a lot of other Islandora 7 sites use the collection search module, it might be good to hear from some them. I'll ask on the email list.

@rangel35
Copy link

I think facets are fine...but some might just want a search when landing on a collection page not after a search...so how about making a view block that uses the id for a filter

@chDay
Copy link

chDay commented Sep 17, 2019

Facets are great, and I love how easy Islandora makes to search my entire repository at once. But almost all of my collections have a use case where the user is visiting just a single, unique collection and would like to search the contents of that collection without having to eliminate all other collections by facet. For a user, it would seem to be best to allow the searching of a single collection to be seamless when visiting that collection.

@alexkent0
Copy link

Not sure how, but I agree that this would be quite useful for Islandora 8.

@bstrakosova
Copy link

bstrakosova commented Sep 23, 2019

I believe you can do this with views and context.

  • Create a View and its Page that contains items of your collection. You can just filter the objects that belong to the collection (in Filter criteria), or if you don't want to search through everything else, you can create index just for your collection and using that (when creating the View, in View settings, select Show: Index [name-of-the-index] instead of Content.) In the Index settings don't forget to add fields that you want to index and set type to Fulltext, if that's what you want.

  • In "Fields" add for example Rendered Item as a field. This is what your search results will look like.

  • In "Filter criteria" add Fulltext search, check "Expose this filter to visitors".

  • In the "Advanced" block, set Exposed form in a block to Yes, end Exposed form style as "Input required". Now you should be done with the view. You can check the page URL (see "Path" in Page settings) to see if everything's working as it should.

  • Create context for the collection. Add Blocks reaction. Add block Exposed form: [name-of-the-view] to the appropriate region (like second sidebar). Don't forget to check "Include blocks from Block layout" if you don't want to build your page layout from the scratch and just want to add this one block. BUT you may want to disable the default search block in Structure - Block layout if you don't want to expose both.

I hope this is what you all had in mind. I'm fairly new to Islandora and I've been just playing with all the Drupal configurations. I'm also not sure how your "collections" work, I've been doing this with content types, so I hope it's all applicable.

@rangel35
Copy link

I did a view/block that I only added on collection pages to list all the members of that collection using the Advanced "Contextual filters" filtering on the member_of field

I didn't open it up for searching but you can add that by exposing the form like @bstrakosova mentioned above and adding fulltext or other filter criteria in the regular view

@bstrakosova
Copy link

I did a view/block that I only added on collection pages to list all the members of that collection using the Advanced "Contextual filters" filtering on the member_of field

I didn't open it up for searching but you can add that by exposing the form like @bstrakosova mentioned above and adding fulltext or other filter criteria in the regular view

Great advice! I totally forgot about the Contextual filters. This way we don't have to create View and Context for every collection and just do it all at once.

@elizoller
Copy link
Member

How would a member_of contextual filter work if you have multiple layers nested? Ie. a collection with items that have items nested within (such as paged content with pages)?

@rangel35
Copy link

good question, can you not give your nested pages two member_of tags, one for the book level and one for the collection level?

since they have different models "Paged Content" vs "Page" you can still display only the top level but search all levels

I haven't tried that but it should work

@seth-shaw-unlv
Copy link
Contributor

Using multiple member_of tags usually breaks breadcrumbs, so I would advise against it. Another possible option (brain-storming here, this is untested) but I wonder if you can get search_api_solr to index the breadcrumbs as a SOLR field and then build a search with a hidden filter for all items where the root node in question appears in that field.

@rangel35
Copy link

we don't have page level metadata and haven't yet implemented ocr so that is why we haven't run across this issue...can another tag be used in place of member_of....we have several tags that have similar functions..because of granularity...we use member_of for direct level up but we also have a "Partner Repository" tag because some of our "Partners" have multiple collections and we would like to be able to target all Partner Objects at the same time

@elizoller
Copy link
Member

I guess one way around the issue is to assume that you only want to surface direct children of a collection as opposed to items which are children of children.

@rangel35
Copy link

once OCR comes into the picture, I see the need for targeting children of children especially the child pages of books.

@rangel35
Copy link

you can also decide how important breadcrumbs are to you....that would make using multiple member_of more feasible, not an ideal situation but still a workable option

@elizoller
Copy link
Member

Regardless of breadcrumbs, I think multiple member_of relationships to represent both child and grandchild relationships wouldn't follow with the concept of graph representation.

@bstrakosova
Copy link

bstrakosova commented Sep 25, 2019 via email

@rangel35
Copy link

@bstrakosova that is what we did for another reason but it would work here too....

@mjordan
Copy link
Contributor Author

mjordan commented Sep 26, 2019

@seth-shaw-unlv the https://github.com/discoverygarden/islandora_collection_search module indexes 'ancestors' by walking up the parental chain. Drupal 8 ships with an "Index Hierarchy" search processor already that applies to taxonomies, which we could probably use as a basis for member_of hierarchies (class file is /var/www/html/drupal/web/modules/contrib/search_api/src/Plugin/search_api/processor/AddHierarchy.php).

@whikloj
Copy link
Member

whikloj commented Oct 11, 2019

As part of the IslandoraCon 2019 use-a-thon a capable team of Islandorians (@alxp, @birkland, Katie Gucer and myself) generated this.
https://docs.google.com/document/d/14a2nsMCojl2aIFBlHac6Npb3LXprBFqbddwfyOcXz28/edit?usp=sharing

It is a work in progress, please review and give us any feedback.

@isithere
Copy link

isithere commented Oct 11, 2019

Here are the work products for the Islandora 8 Collectioneers' submission to the Use-a-Thon:

  1. Documentation (which is both full and points in many interesting directions): https://docs.google.com/document/d/14a2nsMCojl2aIFBlHac6Npb3LXprBFqbddwfyOcXz28/edit?usp=sharing
  2. The presentation (wherein the lobster goes from tears to joy in a mere five slides):
    https://docs.google.com/presentation/d/1QUg4zWwNByU9JQG4U_hzhVouaiZIXyrqbw0xJedJ1v0/edit?usp=sharing

@kstapelfeldt kstapelfeldt added Type: use case proposes a new feature or function for the software using user-first language. and removed use case labels Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: use case proposes a new feature or function for the software using user-first language.
Projects
Development

No branches or pull requests