[Koha-bugs] [Bug 11158] Authorities 'starts with' search returns the same as 'contains' when using ICU

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 5 01:15:03 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11158

--- Comment #9 from David Cook <dcook at prosentient.com.au> ---
Due to my work on Bug 27299, I have renewed interest in this one.

In koha-testing-docker, the following URL
http://localhost:8081/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode=&marclist=mainmainentry&and_or=and&excluding=&operator=start&value=Espen&orderby=HeadingAsc
will generate the following Zebra query:

@attrset Bib-1 @or @attr 1=Heading @attr 7=1 0 @attr 5=1 @attr 4=1 @attr 3=2
@attr 1=Heading-Main Espen

The key part of that is the following:

@attr 5=1 @attr 4=1 @attr 3=2 @attr 1=Heading-Main Espen

Breaking that down:

@attr 5=1 -> Right truncation
@attr 4=1 -> Phrase structure
@attr 3=2 -> Position first in subfield
@attr 1=Heading-Main Espen

As Colin notes, the key is really the addition of a @attr 6=3 to force a
complete field search, which uses the "p" register. 

In my testing, we can leave @attr 3=2 as is, since it doesn't really make a
difference. But adding @attr 6=3 fixes the issue - at least when the patch from
Bug 27299 is applied...

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list