An example of this bug: Library has hidden item type "password" from the OPAC. Library does a search for a publication for which they have a password. On the OPAC - the record is hidden, but the item type facet contains the item type of "Password" even though the item itself is hidden. Clicking the facet brings back no results. We've already hidden them on the Advanced search in bug 12330, it would be good to tidy this up as well.
I know this bug is a little old now, but it is still pertinent. If you have an item type that cannot be viewed on the OPAC it still shows up in the facets. For example, we have an Interlibrary Loan item type that is not visible on the OPAC, but it appears in the facets when it meets the criteria of the search. Clicking on this item type will bring you to an error message. It's confusing to the patron and/or gives the impression that there are problems with the OPAC.
Created attachment 79233 [details] Wrong count for facets Facet should only take in count items that are not hidden.
Still valid !
Because the "OpacHiddenItems" is handled after results are returned from the search engine, it's really hard to do handle the logic well.
+1
We should have separate indexes for OPAC and staff interface. Probably public_* for the OPAC. We could need some trick for when OpacHiddenItemsExceptions is matched (i.e. it should display the full thing).
Would this be just like 2 different itemtype indexes? or "full" index? I think the first might be a good solution, but the opachiddenitems is currently a dymanic setting that works 'on the fly'. I think making new indexes will always require a full reindex so will limit the usefulness of the functionality a bit. Is there an alternative solution where we could filter those from search dynamically?
(In reply to Katrin Fischer from comment #7) > Would this be just like 2 different itemtype indexes? or "full" index? > I think the first might be a good solution, but the opachiddenitems is > currently a dymanic setting that works 'on the fly'. I think making new > indexes will always require a full reindex so will limit the usefulness of > the functionality a bit. > > Is there an alternative solution where we could filter those from search > dynamically? I guess we could build smarter searches based on the context information (OpacHiddenItems, patron category, etc). It would be a not-so-simple development, but of course doable.
I wonder if the options of "exceptions" are not already a "killer" for the index idea - making things more complicated :(
(In reply to Katrin Fischer from comment #9) > I wonder if the options of "exceptions" are not already a "killer" for the > index idea - making things more complicated :( Nah, you would use one query/index or the other depending on that context, which is a mix of settings and the logged-in user category and interface.
Using OpacSuppression is the only way to hide records without those searchengine side-effects.
(In reply to Tomás Cohen Arazi from comment #6) > We should have separate indexes for OPAC and staff interface. > Probably public_* for the OPAC. We could need some trick for when > OpacHiddenItemsExceptions is matched (i.e. it should display the full thing). This is something I've been thinking about when exporting data from Koha into other systems. OpacSuppression, OpacHiddenItems, OpacHiddenItemsExceptions... these all change behaviour without changing the actual data. With OpacSuppression it doesn't matter too much because it's just on/off, but the other 2 require potentially heavy calculations for updating an index...
Our workaround was to add CSS to remove the facet label (Where CustomType is the Item Type we're hiding.): /*Hide the CustomType facet in search results*/ .facet-label a[title="CustomType"] {display: none !important; }
(In reply to Joseph Alway from comment #14) > Our workaround was to add CSS to remove the facet label (Where CustomType is > the Item Type we're hiding.): > /*Hide the CustomType facet in search results*/ > .facet-label a[title="CustomType"] {display: none !important; } To clarify this was added to the OPACUserCSS system preference.
Created attachment 164978 [details] [review] Bug 14007: Hide hidden itemtypes in opac facets. Test plan: * Start koha-testing-docker with elasticsearch or opensearch (e.g., ku-es7) * Make sure there is a built index for Elastic/OpenSearch: > koha-elasticsearch --reset --rebuild kohadev * Search for "book" in opac and note the facet values for itemtype * Change systempreference SearchEngine to ElasticSearch * Search for "book" in opac and note the facet values for itemtype * Go to the adminstration view of one of the itemtypes (for instance Visual Materials) and check "Hide in OPAC". * Search for "book" in opac and make sure the hidden itemtype do not appear as facet. * Search for "book" in staff interface and make sure the hidden itemtype still does appear as a facet. * Change back the systemprefence to Zebra * Search for "book" in opac and make sure the hidden itemtype do not appear as facet. * Search for "book" in staff interface and make sure the hidden itemtype still does appear as a facet.