From 6a65e4ff1905fac8c0ef8e8536a5c35755674360 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 12 Aug 2019 10:43:35 -0300 Subject: [PATCH] [ALTERNATE] Bug 11677: Use zebra not-onloan-count index for availability limit This patch makes the original filter for available items use the 'not-onloan-count' index instead of the 'onloan' one. It keeps the allrecords,AlwaysMatches='' portion of the query so it still catches records with the tested indexed missing. --- C4/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index 4c4a3d0e10..aebbae8770 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1691,7 +1691,7 @@ sub buildQuery { ## In English: ## all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 $availability_limit .= -"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; +"( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) )"; $limit_cgi .= "&limit=available"; $limit_desc .= ""; } -- 2.22.0