Bugzilla – Attachment 194461 Details for
Bug 28884
ElasticSearch: Question mark in title search returns no results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28884: Add 'ElasticsearchEscapeCharacters' and 'OpacElasticsearchEscapeCharacters' system preferences
Bug-28884-Add-ElasticsearchEscapeCharacters-and-Op.patch (text/plain), 5.49 KB, created by
Janusz Kaczmarek
on 2026-03-04 17:39:30 UTC
(
hide
)
Description:
Bug 28884: Add 'ElasticsearchEscapeCharacters' and 'OpacElasticsearchEscapeCharacters' system preferences
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2026-03-04 17:39:30 UTC
Size:
5.49 KB
patch
obsolete
>From 210732f1dd85bd5a89a4a607515d80bbf95c47ad Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Wed, 4 Mar 2026 15:31:24 +0000 >Subject: [PATCH] Bug 28884: Add 'ElasticsearchEscapeCharacters' and > 'OpacElasticsearchEscapeCharacters' system preferences > >--- > .../data/mysql/atomicupdate/bug_28884.pl | 25 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 2 ++ > .../modules/admin/preferences/searching.pref | 8 ++++++ > 3 files changed, 35 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_28884.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_28884.pl b/installer/data/mysql/atomicupdate/bug_28884.pl >new file mode 100755 >index 0000000000..24d99246da >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28884.pl >@@ -0,0 +1,25 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "28884", >+ description => "Add 'ElasticsearchEscapeCharacters' and 'OpacElasticsearchEscapeCharacters' system preferences", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) >+ VALUES ('ElasticsearchEscapeCharacters', '', NULL, 'List of special characters that should always be escaped in intranet searches', 'Free')} >+ ); >+ >+ say $out "Added new system preference 'ElasticsearchEscapeCharacters'"; >+ >+ $dbh->do( >+ q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) >+ VALUES ('OpacElasticsearchEscapeCharacters', '', NULL, 'List of special characters that should always be escaped in intranet searches', 'Free')} >+ ); >+ >+ say $out "Added new system preference 'OpacElasticsearchEscapeCharacters'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 585d7a5d8d..c0688e1265 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -242,6 +242,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('EdifactLSQ', 'location', 'location|ccode|', 'Map EDI sequence code (GIR+LSQ) to Koha Item field, empty to ignore', 'Choice'), > ('ElasticsearchBoostFieldMatch', '0', NULL, 'Add a "match" query to es when searching, will follow indexes chosen in advanced search, or use title-cover for generic keyword or title index search', 'YesNo'), > ('ElasticsearchCrossFields', '1', NULL, 'Enable "cross_fields" option for searches using Elastic search.', 'YesNo'), >+('ElasticsearchEscapeCharacters', '', NULL, 'List of special characters that should always be escaped in intranet searches', 'Free'), > ('ElasticsearchIndexStatus_authorities', '0', 'Authorities index status', NULL, NULL), > ('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL), > ('ElasticsearchMARCFormat', 'base64ISO2709', 'base64ISO2709|ARRAY', 'Elasticsearch MARC format. ISO2709 format is recommended as it is faster and takes less space, whereas array is searchable.', 'Choice'), >@@ -509,6 +510,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), > ('OPACDisableSendList','0',NULL,'Allow OPAC users to email lists via a "Send list" button','YesNo'), > ('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'), >+('OpacElasticsearchEscapeCharacters', '', NULL, 'List of special characters that should always be escaped in intranet searches', 'Free'), > ('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd',NULL,'Define export options available on OPAC detail page.','multiple'), > ('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'), > ('OpacFavicon','',NULL,'Enter a complete URL to an image to replace the default Koha favicon on the OPAC','Free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index 99c045d696..f8519bda77 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -131,6 +131,14 @@ Searching: > - "<pre>ccode: [REF,ARC]</pre><br/> - would mark all REF and ARC collections (Reference and Archives) items as unavailable in Z3950 results.<br/><br/>" > - "You can define multiple keys and values, items meeting ANY of the criteria will be marked unavailable:<br/><br/>" > - "<pre>itype: [REF]<br/>holdingbranch: [REPAIR]</pre><br/> - would mark all reference items AND items at the REPAIR branch as unavailable." >+ - >+ - "The following characters will always be escaped in intranet searches (with Elasticsearch):" >+ - pref: ElasticsearchEscapeCharacters >+ class: short >+ - ".</br>" >+ - "The following characters will always be escaped in OPAC searches (with Elasticsearch):" >+ - pref: OpacElasticsearchEscapeCharacters >+ class: short > Search form: > - > - pref: LoadSearchHistoryToTheFirstLoggedUser >-- >2.39.5
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 28884
:
147161
|
194458
|
194459
|
194460
| 194461