Bug 22874 - Limit to available items doesn't work with elasticsearch 6.x
Summary: Limit to available items doesn't work with elasticsearch 6.x
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Alex Arnaud
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 20196
  Show dependency treegraph
 
Reported: 2019-05-09 10:29 UTC by Alex Arnaud
Modified: 2021-06-14 21:28 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00
Circulation function:


Attachments
Bug 22874 - use false instaed of 0 value for limiting on availability (2.12 KB, patch)
2019-05-09 12:41 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 22874 - use false instaed of 0 value for limiting on availability (2.33 KB, patch)
2019-10-01 12:14 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 22874: Use false instaed of 0 value for limiting on availability (2.39 KB, patch)
2019-10-25 16:19 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Arnaud 2019-05-09 10:29:07 UTC
Currently we send "onloan:0" to ES to get records with available items.
But ES 6 does not considers 0 as a valid boolean.

On ES 6.x:
onloan:0 => doesn't work
onloan:false => works

On ES 5.x:
onloan:0 => works
onloan:false => works

So it seems we can have compatibility for both ES 5 and ES 6 by using false instead of 0.

Patch is coming.
Comment 1 Alex Arnaud 2019-05-09 12:41:06 UTC
Created attachment 89506 [details] [review]
Bug 22874 - use false instaed of 0 value for limiting on availability

Test plan

  - Set up a elasticsearch 6 instance to work with Koha,
  - you may need to make koha works with ES 6 (see bug 20589),
  - make a search and limit it to available items only,
  => no result

  - Apply this patch,
  - make a search and limit it to available items only,
  - you should get some results

  - Do the same with ES 5.x
Comment 2 Séverine Queune 2019-10-01 11:28:54 UTC
Here are the 2 sandboxes I used with : 
  - ES5 : http://pro.es5-koha.sandbox.biblibre.eu
  - ES6 : http://pro.es6-koha.sandbox.biblibre.eu

Sorry Alex, they both failed...
Comment 3 Biblibre Sandboxes 2019-10-01 12:14:13 UTC
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Comment 4 Biblibre Sandboxes 2019-10-01 12:14:38 UTC
Created attachment 93359 [details] [review]
Bug 22874 - use false instaed of 0 value for limiting on availability

Test plan

  - Set up a elasticsearch 6 instance to work with Koha,
  - you may need to make koha works with ES 6 (see bug 20589),
  - make a search and limit it to available items only,
  => no result

  - Apply this patch,
  - make a search and limit it to available items only,
  - you should get some results

  - Do the same with ES 5.x

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 5 Nick Clemens (kidclamp) 2019-10-25 16:19:51 UTC
Created attachment 94792 [details] [review]
Bug 22874: Use false instaed of 0 value for limiting on availability

Test plan

  - Set up a elasticsearch 6 instance to work with Koha,
  - you may need to make koha works with ES 6 (see bug 20589),
  - make a search and limit it to available items only,
  => no result

  - Apply this patch,
  - make a search and limit it to available items only,
  - you should get some results

  - Do the same with ES 5.x

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Martin Renvoize (ashimema) 2019-10-28 12:39:02 UTC
Nice work!

Pushed to master for 19.11.00