Bugzilla – Attachment 181640 Details for
Bug 39770
Limiting subtypes by Braille doesn't work when searching with Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39770: Fix wrong Braille format search for Elasticsearch
Bug-39770-Fix-wrong-Braille-format-search-for-Elas.patch (text/plain), 2.98 KB, created by
Peter Vashchuk
on 2025-04-29 09:56:03 UTC
(
hide
)
Description:
Bug 39770: Fix wrong Braille format search for Elasticsearch
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2025-04-29 09:56:03 UTC
Size:
2.98 KB
patch
obsolete
>From d05f25dcbc5d3cc5dfcc82ed9806ae1949532715 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Tue, 29 Apr 2025 12:55:13 +0300 >Subject: [PATCH] Bug 39770: Fix wrong Braille format search for Elasticsearch >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >ElasticSearch couldn't find any books that have Braille: No results match your search with limit(s): 'ff7-01-02:("tc or fb")'. It was a problem because the "l-format:tc or fb" only works for Zebra and is incorrect way to search with OR for ElasticSearch. > >Elastic requires the syntax to be l-format:"tc" OR "fbâ (uppercase OR and each format in double quotes) instead. > >This patch fixes it by checking which search engine you use depending on the current syspref SearchEngine and provides the correctly formatted format. > >To reproduce: >1. Have ElasticSearch enabled and check that you have books with braille, or make up one yourself by adding "tc" (text - Braille) or "fb" (tactile material - braille) to 007 MARC field. >2. Go to catalogue/advanced search and select format: braille, from the dropdown. >3. Try to find anything, if you are using ElasticSearch you will see: No results match your search with limit(s): 'ff7-01-02:("tc or fb")' >4. Do the same with Zebra instead of Elastic, it should work properly and you should see all the books that have Braille. >5. Apply the patch. >6. Repeat same search both using ElasticSearch and then Zebra. Both ElasticSearch and Zebra should work without any issues. >--- > .../prog/en/includes/subtype_limits.inc | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc >index 01712ec06c7..07efc0ee87b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc >@@ -101,10 +101,18 @@ > [% ELSE %] > <option value="l-format:tb">Large print</option> > [% END %] >- [% IF (limits.$lformat.0 == 'tc or fb' ) %] >- <option value="l-format:tc or fb" selected="selected">Braille</option> >- [% ELSE %] >- <option value="l-format:tc or fb">Braille</option> >+ [% IF (Koha.Preference('SearchEngine') == 'Elasticsearch') %] >+ [% IF (limits.$lformat.0 == 'tc OR fb') %] >+ <option value='l-format:tc" OR "fb' selected="selected">Braille</option> >+ [% ELSE %] >+ <option value='l-format:tc" OR "fb'>Braille</option> >+ [% END %] >+ [% ELSE %] >+ [% IF (limits.$lformat.0 == 'tc or fb') %] >+ <option value="l-format:tc or fb" selected="selected">Braille</option> >+ [% ELSE %] >+ <option value="l-format:tc or fb">Braille</option> >+ [% END %] > [% END %] > <option value="">-----------</option> > [% IF (limits.$lformat.0 == 'sd' ) %] >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39770
: 181640