[Bug 21146] New: Elasticsearch 5.6+ doesn't consider '0' a valid boolean
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 Bug ID: 21146 Summary: Elasticsearch 5.6+ doesn't consider '0' a valid boolean Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com To reproduce: - Set SearchEngine=Zebra - Run: $ kshell k$ prove prove t/db_dependent/Circulation/Returns.t => SUCCESS: Tests pass! - Set SearchEngine=Elasticsearch - Run: k$ prove prove t/db_dependent/Circulation/Returns.t => FAIL: Things explode because '0' is not a valid boolean for Elasticsearch (legacy fallback in past versions). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20196 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20196 [Bug 20196] [Omnibus] Prepare Koha to ElasticSearch6 - ES6 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Maybe: diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 9c114fb060..c7081ee559 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -308,7 +308,11 @@ sub get_fixer_rules { # boolean gets special handling, basically if it doesn't exist, # it's added and set to false. Otherwise we can't query it. push @rules, - "unless exists('$name') add_field('$name', 0) end"; + "if is_true('$name') + add_field('$name', 'true') + else + add_field('$name', 'false') + end"; } if ($type eq 'sum' ) { push @rules, "sum('$name')"; -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex.arnaud@biblibre.com, | |ere.maijala@helsinki.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |https://discuss.elastic.co/ | |t/perl-and-new-boolean-rest | |riction-in-es5/94529 | |https://github.com/LibreCat | |/Catmandu/wiki/Fixes-Cheat- | |Sheet -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL|https://discuss.elastic.co/ |https://discuss.elastic.co/ |t/perl-and-new-boolean-rest |t/perl-and-new-boolean-rest |riction-in-es5/94529 |riction-in-es5/94529 |https://github.com/LibreCat | |/Catmandu/wiki/Fixes-Cheat- | |Sheet | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@helsinki.fi --- Comment #2 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- if accepted, Bug #19893 will fix this. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21146 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE CC| |nick@bywatersolutions.com Status|NEW |RESOLVED --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- *** This bug has been marked as a duplicate of bug 19893 *** -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org