Libraries might repurpose their OPAC to only search certain records. These records might still have relevant collection, item type, shelving location information, so it doesn't work to use these fields to filter OPAC searches on. It might be easier to add a 'keyword' to the MARC for these records, and have Koha secretly apply this keyword to the search, when switched on.
Created attachment 163969 [details] [review] Bug 36434: Use a keyword that will be secretly included in all OPAC bibliographic and authority searches When a keyword is provided to the new OPACAlwaysSearchKeyword system preference, Koha will secretly add this to all OPAC searches (both bibliographic and authority) to help limit results. Note: This will have unexpected results if authority searches are done with 'starts with' or 'is exactly'. It is only designed to work with 'contains'. To test: 1. Install database updates and restart services. 2. Do a standard OPAC search using the main search bar for 'this that'. Notice the number of results. 3. Do an advanced OPAC search, specify keyword: 'this' and keyword: 'that'. Notice the number of results. 4. In the staff interface, do a biblio search for 'this that'. Edit the first two records, and put your test keyword somewhere in the MARC, perhaps a note field 5XX. 5. Go to the Koha Administration -> System preferences and search for OPACAlwaysSearchKeyword. Add your test keyword to the syspref and Save. 6. Repeat steps 2 and 3. Confirm results are returned, and there should only be your two records which you added the test keyword to. 7. Remove the test keyword from OPACAlwaysSearchKeyword and Save. 8. Do an OPAC authority search for 'series'. Notice the number of results. 9. In the staff interface, do an authority search for 'series'. Edit the first two records, and put your test keyword somewhere in the MARC, perhaps in the 040$f. 10. Repeat step 5. 11. Repeat steps 8 and 9. Confirm results are returned, and there should only be your two records which you added the test keyword to. 12. Click on 'Welcome, your name' in the top right of the OPAC and go to your search history. Confirm the test keyword added to OPACAlwaysSearchKeyword does NOT show in your history, for both catalog and authority searches. 13. Confirm all results are returned as normal when OPACAlwaysSearchKeyword is empty. Sponsored-by: Auckland University of Technology
I'm not sure I understand the purpose of this feature. Is this something like what you could do with OpacHiddenItems system preference?
Or with OpacSuppression system preference and suppress information in biblio record's 942$n field?
Why couldn't the term just be included as a very specific subject heading or authority?
Can you explain the use case for this a bit more? Personally Im not a fan of "secertly" doing things that effect patron's searches. I think this hurts findability/disoverability for patrons. Maybe outlining a use case for us will help understand why this is needed.
In our case we have a library wanting to use their OPAC just for their archives collection. They use VuFind on top of Koha for searching their regular collection. By default, we want the OPAC to exclude the regular collection from searches. This isn't as simple as using OpacHiddenItems because if the record doesn't have holdings then it won't be used. We can't filter based on item types and collection codes because archives items still use these, just like the normal collection. We also can't use OpacSuppression or the 942$n on the regular holdings or they'll be excluded from the VuFind harvest. Hopefully that explains the use case. Open to ideas on better ways to do this, for e.g. we could put the OPACAlwaysSearchKeyword back in the search history so the user knows about it.
The concern with this approach is the potential for abuse over time. Search engines have been accused of such things for years. OpacHiddenItems can hide the one collection in the Koha OPAC. What is available for display/use in the Discovery Layer depends on how the discovery layer handles the OpacHiddenItems flag. It is perhaps better handled at the discovery layer level and not Koha directly.
I understand the concerns. The issue for us is that we can't use OpacHiddenItems to exclude everything except our archives, because the discovery layer includes OpacHiddenItems in the harvest. The OPAC will be used to search opposite records from the discovery layer. This is a niche use case so if it is too risky to upstream then that's totally fine, we can maintain it as a customisation for this library. Please feel free to change bug status.
Just curious, what is the keyword you are using/where is it stored in the MARC record? Koha technically does use a forced hidden keyword in searching for suppressed records - we append 'suppress=0' for opac searches. Maybe if this cannot be handled through the current suppression module, the development could extend the fields used to define suppression and allow for another field/value to be suppressed? At least with Elasticsearch this should be easily configurable out of the box
We're putting a keyword like 'archive' in records that must not go through to the discovery layer, and must be searchable on the OPAC. That sounds like an interesting idea
"This will have unexpected results if authority searches are done with 'starts with' or 'is exactly'. It is only designed to work with 'contains'" What are the unexpected results? That sounds scary.