From f5d5f4fb42a68c258236fe01ee89e7d2037a979f Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 5 Jan 2021 00:21:16 +0000 Subject: [PATCH] Bug 11158: Add complete field to authority "starts with" search This patch adds "complete field" to the authority "starts with" search so that it uses the untokenized "p" register. Test plan: 1. Apply the patch 2. koha-plack --restart kohadev 3. Go to http://localhost:8081/cgi-bin/koha/authorities/authorities-home.pl 4. Type in "Espen" into the search box and hit "Submit" 5. Note that there are 3 results 6. Change "contains" to "starts with" and hit "Submit" 7. Note that no results are returned 8. Change the search from "Espen" to "Sandberg" and hit "Submit" 9. Note that 3 results are returned 10. Experiment to your heart's content and rejoice at your new found power --- C4/AuthoritiesMarc.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index b20293b56a..a5991a447b 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -178,8 +178,8 @@ sub SearchAuthorities { $attr .= " \@attr 4=107 "; #Number Exact match } elsif ( $operator and $operator eq "start" ) { - $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 " - ; #Firstinfield Phrase, Right truncated + $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 \@attr 6=3 " + ; #Firstinfield Phrase, Right truncated, Complete field } elsif ( $operator and $operator eq "exact" ) { $attr .= " \@attr 4=1 \@attr 5=100 \@attr 6=3 " -- 2.11.0