Bug 17132

Summary: Availability search broken when using Elastic
Product: Koha Reporter: Kyle M Hall <kyle>
Component: SearchingAssignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jschmidt, mtj, nick, sandboxes
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 17132 - Availability search broken when using Elastic
Bug 17132 - Availability search broken when using Elastic
Bug 17132 - Availability search broken when using Elastic

Description Kyle M Hall 2016-08-15 18:12:03 UTC
Elastic appears to be indexing onloan as a string, but our code assumes it is a boolean.
Comment 1 Kyle M Hall 2016-08-15 18:13:42 UTC Comment hidden (obsolete)
Comment 2 J Schmidt 2016-09-06 15:44:26 UTC
I went into the PTFS Sandbox (1) and did a search for 'the' to find items in the test database. I found some titles having status of available.. I then went to "Search the Catalog" and did numerous searches (e.g., The middle east and brazil)...I was able to bring up results (Success). I went under the Advanced Search area and did the same. I was able to again retrieve results successfully. Following the test plan below this bug appears to meet the status of signed off.
Comment 3 PTFS Europe Sandboxes 2016-09-06 15:44:49 UTC
Patch tested with a sandbox, by Jennifer Schmidt <jschmidt@switchinc.org>
Comment 4 PTFS Europe Sandboxes 2016-09-06 15:45:10 UTC
Created attachment 55262 [details] [review]
Bug 17132 - Availability search broken when using Elastic

Elastic appears to be indexing onloan as a string, but our code assumes
it is a boolean.

Test Plan:
1) Ensure you are set up using Elastic as your search engine
2) Search only for available items from the advanced search
3) Note you get no results
4) Apply this patch
5) Re-run the search
6) You should now get results!

Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>
Comment 5 J Schmidt 2016-09-06 15:50:51 UTC
I checked out Once upon a time 39999000016376... to patron aitken, bailey then performed searches as the title is not available and it was retrieved in basic and advanced search (I did a title search using 'the time')... listed correctly as on loan and retrieve other results.
Comment 6 Nick Clemens 2016-10-13 13:25:39 UTC
I can't recreate this, 'false' seems to be acceptable to elastic as a boolean value https://www.elastic.co/guide/en/elasticsearch/reference/current/boolean.html
Comment 7 Jonathan Druart 2016-11-22 08:59:21 UTC
Created attachment 57692 [details] [review]
Bug 17132 - Availability search broken when using Elastic

Elastic appears to be indexing onloan as a string, but our code assumes
it is a boolean.

Test Plan:
1) Ensure you are set up using Elastic as your search engine
2) Search only for available items from the advanced search
3) Note you get no results
4) Apply this patch
5) Re-run the search
6) You should now get results!

Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Kyle M Hall 2016-11-22 11:36:40 UTC
Pushed to master for 16.11!
Comment 9 Mason James 2016-12-14 11:35:17 UTC
Pushed to 16.05.x, for 16.05.06 release