Summary: | Elasticsearch 5.6+ doesn't consider '0' a valid boolean | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Searching - Elasticsearch | Assignee: | Bugs List <koha-bugs> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | alex.arnaud, ere.maijala, joonas.kylmala, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
URL: | https://discuss.elastic.co/t/perl-and-new-boolean-restriction-in-es5/94529 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 20196 |
Description
Tomás Cohen Arazi (tcohen)
2018-08-02 10:14:34 UTC
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')"; if accepted, Bug #19893 will fix this. |