From 08612d98fc446bf1b97b1406266789680fccc9d6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 8 Aug 2022 12:15:16 +0000 Subject: [PATCH] Bug 25375: Match current Zebra availability limit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In Zebra the availability limit code states: 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) We should make ES follow the same behaviour so that changing the engine does not change this. To test: 1 - Find or create several records with two items each 2 - For those records setup items as: a - one checked out, one available b - both marked lost c - both damaged d - both withdrawn e - both notforloan 3 - Enable ES and reindex to confirm everything is set 4 - Perform an advanced search to return those records and 'limit to available items' 5 - Confirm you see records b,c,d,e and records say '2 items, none available' 6 - Apply patch 7 - Run `misc/search_tools/rebuild_elasticsearch.pl -d -b` 8 - Perform an advanced search to return those records and 'limit to available items' 9 - Confirm you see records a,b,c,d and al but a say '2 items, none available' Signed-off-by: Joonas Kylmälä Signed-off-by: Tomas Cohen Arazi (cherry picked from commit b6ace414f72be24949acb07f1c739bb031cc1faf) Signed-off-by: Lucas Gass (cherry picked from commit 245085d202c00f98079912cb72badf901091e163) Signed-off-by: Arthur Suzuki --- Koha/SearchEngine/Elasticsearch.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index cf5cf79a5d..9aa8d0c54f 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -780,9 +780,6 @@ sub marc_records_to_documents { biblionumber => $biblionumber, onloan => undef, notforloan => 0, - withdrawn => 0, - itemlost => 0, - damaged => 0 })->count; $record_document->{available} = $avail_items ? \1 : \0; -- 2.39.5