[Koha-bugs] [Bug 31061] New: OPACSuppress does not work properly with Elasticsearch

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jun 28 21:42:38 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31061

            Bug ID: 31061
           Summary: OPACSuppress does not work properly with Elasticsearch
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Searching - Elasticsearch
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: fridolin.somers at biblibre.com

OPACSuppress is system preference to hide records in OPAC search by adding a
limit in search query.

With Zebra, this limit is : not Suppress=1
https://git.koha-community.org/Koha-community/Koha/src/commit/244b847a08bf61a747a1e4be4eed86cc776eabd6/Koha/SearchEngine/Zebra/QueryBuilder.pm#L83
With Elasticsearch this limit is currently quite different : suppress:false
https://git.koha-community.org/Koha-community/Koha/src/commit/244b847a08bf61a747a1e4be4eed86cc776eabd6/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm#L286

Main problem is that in default framework we define Suppress search field on
942$n with authorized values YES_NO.
This generates records with 1 for YES and 0 for NO.
But a boolean for Elasticsearch is not a perl boolean.
So only missing subfield means false :
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/boolean.html
Records with 0 are hidden !

Another side-effect :
We whould like to have several MARC fields with 'suppress' search field.
To distinguish several causes of hidden at OPAC.
Any of those fields having 1 must hide at OPAC.
So syntax 'NOT(suppress:1)' is more correct.

I propose we change to have the same behavior as Zebra.
Change 'suppress' search field to not remove boolean type.
Change QueryBuilder to use 'NOT(suppress:1)'.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list