Bug 28801

Summary: OpacSuppression prevents retrieval of non-suppressed titles that contain punctuation
Product: Koha Reporter: T. Keagan <tasha.keagan>
Component: OPACAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: dcook, jonathan.druart, mathsabypro
Version: 20.11   
Hardware: Other   
OS: Linux   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description T. Keagan 2021-08-03 01:57:17 UTC
Overview: OpacSuppression toggled to "hide" reliably prevents results from being retrieved in the OPAC when titles (245$a) contain punctuation (in my catalog, these are mostly hyphens/dashes and parentheses).  Punctuated titles are retrievable until I toggle OpacSuppression to "hide", despite having their 942$n set to "n Suppress in OPAC No" (Titles that do have 942$n set to "yes" are suppressed as expected and labelled as such in the intranet).  
   

Steps to Reproduce:

Note: I was working in a clean Koha install, with no MARC records, where the only Global System Preference toggled was SearchEngine (to use Elasticsearch).

1. I created a record using the Fast Add framework, with title "Test punctuated (TST-123) title", and only required fields populated

2. In the OPAC, I searched for and successfully retrieved the title using the "Library catalog" search option

3. I toggled OpacSuppression to "Hide", then used Ctrl+F5 to refresh the browser

4. In the OPAC, I repeated the "Library catalog" search

Actual Results: 

"No results found!
No results found for that in catalog."
 
Expected Results: 

I expected the title to be retrieved.
 
Build Date & Hardware: 
I believe you're looking for this info:  Linux 5.4.17-2011.6.2.el7uek.x86_64 #2 SMP Thu Sep 3 14:09:14 PDT 2020 x86_64
Comment 1 David Cook 2021-08-03 02:22:37 UTC
Did you put "No" as a value in the 942$n?
Comment 2 Jonathan Druart 2021-08-03 09:22:38 UTC
I don't recreate what you describe (tested on master and 20.11.x), the title is always displayed.
Comment 3 T. Keagan 2021-08-03 20:23:13 UTC
(In reply to David Cook from comment #1)
> Did you put "No" as a value in the 942$n?

Hi David.  The display value is "No".  The authorized value is "0", populated by the Fast Add Framework, which has the YES_NO authorized values linked to it by default.  

The suppression that is happening is not "normal", meaning that the label, "Suppressed in OPAC", isn't being applied to the record when viewed in the intranet.
Comment 4 T. Keagan 2021-08-03 20:28:03 UTC
(In reply to Jonathan Druart from comment #2)
> I don't recreate what you describe (tested on master and 20.11.x), the title
> is always displayed.

Thank you Jonathan.  Perhaps this is particular to our tech stack. We're using Oracle Linux and Percona SQL Server.  Maybe something is up with Perl.  We've duplicated this issue on multiple machines.  Since I'm working in a new instance with only four MARC records in it, it seems like the only variable is toggling OpacSuppression.  I see nothing useful in the logs, although I get the warnings below regardless of whether OpacSuppression is toggled:

[2021/08/03 09:26:45] [WARN] Use of uninitialized value $f in pattern match (m//) at /usr/share/koha/lib/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 725.
[2021/08/03 09:26:45] [WARN] Use of uninitialized value $f in exists at /usr/share/koha/lib/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 729.

Perhaps I will just need to set this aside until I have time to go through the code.  I am mystified.  Thanks for your time.
Comment 5 David Cook 2021-08-04 00:00:34 UTC
Since you're using an atypical stack and folk here can't reproduce it, it sounds like this might be more of a support request than a bug report. 

I don't use Elasticsearch with Koha, so I'm probably not much help there. However, are you able to reproduce the same problem when using Zebra instead of Elasticsearch for your SearchEngine?
Comment 6 Jonathan Druart 2021-08-04 06:36:14 UTC
Try on one sandbox https://wiki.koha-community.org/wiki/Sandboxes

If you recreate the problem there, then provide us the step-by-step plan to reproduce it.
Comment 7 Katrin Fischer 2023-07-01 12:46:33 UTC
(In reply to Jonathan Druart from comment #6)
> Try on one sandbox https://wiki.koha-community.org/wiki/Sandboxes
> 
> If you recreate the problem there, then provide us the step-by-step plan to
> reproduce it.

We had no reply here, closing as INVALID.