Bugzilla – Attachment 113220 Details for
Bug 26860
Add search limit for records without items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26860: (follow-up) case requesting zebra with ccl query
Bug-26860-follow-up-case-requesting-zebra-with-ccl.patch (text/plain), 2.21 KB, created by
Fridolin Somers
on 2020-11-06 09:18:27 UTC
(
hide
)
Description:
Bug 26860: (follow-up) case requesting zebra with ccl query
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-11-06 09:18:27 UTC
Size:
2.21 KB
patch
obsolete
>From 0bdbd28b714ec8cf3c5a36202bce2a225c96dc2b Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 6 Nov 2020 10:10:14 +0100 >Subject: [PATCH] Bug 26860: (follow-up) case requesting zebra with ccl query > >When calling a ccl syntax query, code must be added like for >availability facet. >See Bug 17278: Use available limit when requesting zebra when ccl query is used > >This patch also changes "grep {!/^available$/} @limits" to use "grep { $_ ne 'available' } @limits". >Following the logic of : >Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} > >Test plan : >1) Use Zebra search engine >2) Perform a search on staff interface with explicit index, for example 'ti:history' >3) This search must return some records with and some without items >4) Click on 'Limit to records without items' >5) Check you see only records without items >6) Click on 'Show all records' >7) Check you see all records again >8) Check availability facet is also working >--- > C4/Search.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index fc23a4df43..9988ae4c62 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1315,10 +1315,18 @@ sub buildQuery { > $q =~ s| and \( \(allrecords,AlwaysMatches=''\) and \(not-onloan-count,st-numeric >= 1\) and \(lost,st-numeric=0\) \)||; > $original_q = $q; > } >+ unless ( grep { $_ eq 'withoutitems' } @limits ) { >+ $q =~ s| and \( allrecords,AlwaysMatches='' not\(homebranch,AlwaysMatches=''\) \)||; >+ $original_q = $q; >+ } > if ( @limits ) { > if ( grep { $_ eq 'available' } @limits ) { > $q .= q| and ( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) )|; >- @limits = grep {!/^available$/} @limits; >+ @limits = grep { $_ ne 'available' } @limits; >+ } >+ if ( grep { $_ eq 'withoutitems' } @limits ) { >+ $q .= q| and ( allrecords,AlwaysMatches='' not(homebranch,AlwaysMatches='') )|; >+ @limits = grep { $_ ne 'withoutitems' } @limits; > } > $q .= ' and '.join(' and ', @limits) if @limits; > } >-- >2.29.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26860
:
112858
|
112859
|
112913
|
112914
|
112931
|
112932
|
113220
|
119112
|
119113
|
119114
|
120994
|
124125
|
124126
|
124127