If you choose "Shelving location" in the staff interface dropdown menu, it generates an invalid Zebra search. Example: 14:21:54-17/10 zebrasrv(3) [request] Search biblios ERROR 114 1 1+0 RPN @attrset Bib-1 @or @or @attr 1=8013 @attr 4=1 @attr 6=3 @attr 9=32 @attr 2=102 WEB @attr 1=8013 @attr 4=1 @attr 9=26 @attr 2=102 WEB @a ttr 1=8013 @attr 4=6 @attr 9=20 @attr 2=102 WEB Here's what we actually want to create: 14:21:48-17/10 zebrasrv(2) [request] Search biblios OK 20892 1 1+0 RPN @attrset Bib-1 @attr 1=8013 @attr 4=6 @attr 2=102 WEB
Ok it's working in master although it doesn't set the index dropdowns correctly so I guess I can re-purpose this report...
Or maybe not... certain permutations of sysprefs don't work...
In Master: 1) Turn off QueryAutoTruncate 2) Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=GEN&idx=location 3) Note "No results found" The problem is that QueryWeightFields adds a "phr" qualifier which is a problem since "location" doesn't have a phrase index defined...: (rk=( location,ext,r1=" GEN " or location,phr,r3=" GEN " or location,wrdl,r6=" GEN " or location,wrdl,fuzzy,r8=" GEN " or location,wrdl,rt,r9=""gen"? "))
Created attachment 141950 [details] [review] Bug 31841: Use location,wrdl when searching Shelving location The "location" index only has a word index defined, so we need to specify the wrdl qualifier when searching it via the staff interface dropdown menu Test plan: 1) Change QueryAutoTruncate to "only if * is added" 2) Change IntranetCatalogSearchPulldown to "Show" 3) Search for "Shelving location" of "GEN" in catalogue search bar 4) Note no results returned 5) Apply patch 6) koha-plack --restart kohadev 7) Repeat Step #3 8) Note that results appear for 'location,wrdl: GEN'
Hi David, did you mean to sign-off here?
(In reply to Katrin Fischer from comment #5) > Hi David, did you mean to sign-off here? I'm not sure I understand the question? [U+1F605]
(In reply to David Cook from comment #6) > (In reply to Katrin Fischer from comment #5) > > Hi David, did you mean to sign-off here? > > I'm not sure I understand the question? [U+1F605] Sorry, I got confused :)
(In reply to Katrin Fischer from comment #7) > Sorry, I got confused :) No worries! I'd love to someone to sign it off though heh.
> since "location" doesn't have a phrase index defined... Why not add it to Zebra MARC21 configuration ? Even if unlikely : Imagine two locations "foo bar" and "bar foo", words list type search "wrdl" will match both. This indexing can be useful for other cases.
(In reply to Fridolin Somers from comment #9) > > since "location" doesn't have a phrase index defined... > Why not add it to Zebra MARC21 configuration ? I suppose I try to avoid Zebra config changes that require people to re-index but fair point! > Even if unlikely : > Imagine two locations "foo bar" and "bar foo", words list type search "wrdl" > will match both. True although I have wanted to limit authorized value codes for a while so that they can only be alphanumeric and have no spaces heh.
Sorry, patch does not apply and I don't see how to resolve the conflict: $ git bz apply 31841 Bug 31841 - Shelving location search in staff interface sometimes creates invalid Zebra query 141950 - Bug 31841: Use location,wrdl when searching Shelving location Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 31841: Use location,wrdl when searching Shelving location Using index info to reconstruct a base tree... M koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc error: Failed to merge in the changes. Patch failed at 0001 Bug 31841: Use location,wrdl when searching Shelving location hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-31841-Use-locationwrdl-when-searching-Shelving-qsJQXm.patch <<<<<<< HEAD [% IF ms_location %] <option selected="selected" value="location" title="Enter location code value for search">Shelving location (code)</option> ======= [% IF ms_locationcommawrdl %] <option selected="selected" value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option> >>>>>>> Bug 31841: Use location,wrdl when searching Shelving location
Thanks for looking Magnus. It's a simple fix. I'll look at doing that now actually...
(In reply to Fridolin Somers from comment #9) > > since "location" doesn't have a phrase index defined... > Why not add it to Zebra MARC21 configuration ? > > Even if unlikely : > Imagine two locations "foo bar" and "bar foo", words list type search "wrdl" > will match both. > > This indexing can be useful for other cases. It might be worth adding that the status quo right now is doing a "wrdl" search for "location", so I'm just trying to make the status quo explicit and functional in all cases.
Created attachment 148848 [details] [review] Bug 31841: Use location,wrdl when searching Shelving location The "location" index only has a word index defined, so we need to specify the wrdl qualifier when searching it via the staff interface dropdown menu Test plan: 1) Change QueryAutoTruncate to "only if * is added" 2) Change IntranetCatalogSearchPulldown to "Show" 3) Search for "Shelving location" of "GEN" in catalogue search bar 4) Note no results returned 5) Apply patch 6) koha-plack --restart kohadev 7) Repeat Step #3 8) Note that results appear for 'location,wrdl: GEN'
(In reply to David Cook from comment #13) > (In reply to Fridolin Somers from comment #9) > > > since "location" doesn't have a phrase index defined... > > Why not add it to Zebra MARC21 configuration ? > > > > Even if unlikely : > > Imagine two locations "foo bar" and "bar foo", words list type search "wrdl" > > will match both. > > > > This indexing can be useful for other cases. > > It might be worth adding that the status quo right now is doing a "wrdl" > search for "location", so I'm just trying to make the status quo explicit > and functional in all cases. OKi no problem. A fix that works is a good fix ;)
Created attachment 148856 [details] [review] Bug 31841: Use location,wrdl when searching Shelving location The "location" index only has a word index defined, so we need to specify the wrdl qualifier when searching it via the staff interface dropdown menu Test plan: 1) Change QueryAutoTruncate to "only if * is added" 2) Change IntranetCatalogSearchPulldown to "Show" 3) Search for "Shelving location" of "GEN" in catalogue search bar 4) Note no results returned 5) Apply patch 6) koha-plack --restart kohadev 7) Repeat Step #3 8) Note that results appear for 'location,wrdl: GEN' Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised.
Created attachment 148916 [details] [review] Bug 31841: Use location,wrdl when searching Shelving location The "location" index only has a word index defined, so we need to specify the wrdl qualifier when searching it via the staff interface dropdown menu Test plan: 1) Change QueryAutoTruncate to "only if * is added" 2) Change IntranetCatalogSearchPulldown to "Show" 3) Search for "Shelving location" of "GEN" in catalogue search bar 4) Note no results returned 5) Apply patch 6) koha-plack --restart kohadev 7) Repeat Step #3 8) Note that results appear for 'location,wrdl: GEN' Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Doesn't apply cleanly to 22.05.x, no backport.
(In reply to David Cook from comment #3) > In Master: > 1) Turn off QueryAutoTruncate > 2) Go to > http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=GEN&idx=location > 3) Note "No results found" > > The problem is that QueryWeightFields adds a "phr" qualifier which is a > problem since "location" doesn't have a phrase index defined...: > > (rk=( location,ext,r1=" GEN " or location,phr,r3=" GEN " or > location,wrdl,r6=" GEN " or location,wrdl,fuzzy,r8=" GEN " or > location,wrdl,rt,r9=""gen"? ")) We have seen other problems like that. We should add phrase search to all search fields to fix once and for all. But for this cas, it disables autotruncation of location code, so its a good fix.