From e4635358bfe036594054804d236b4edd4d34cbf9 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Thu, 28 May 2020 14:30:03 +0200 Subject: [PATCH] Bug 25616: Uppercase hard coded lower case boolean operators for Elasticsearch Uppercase occurances of all (hopefully) lowercase "and" used in ElasticSearch Query String Query contexts --- C4/Biblio.pm | 6 +++--- C4/Heading.pm | 4 ++-- cataloguing/value_builder/marc21_linking_section.pl | 2 +- cataloguing/value_builder/unimarc_field_4XX.pl | 2 +- misc/migration_tools/bulkmarcimport.pl | 4 ++-- serials/subscription-bib-search.pl | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 9eb3696a54..0e8a29562d 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1603,7 +1603,7 @@ sub GetMarcSubjects { push @link_loop, { limit => $subject_limit, 'link' => $linkvalue, - operator => (scalar @link_loop) ? ' and ' : undef + operator => (scalar @link_loop) ? ' AND ' : undef }; } my @this_link_loop = @link_loop; @@ -1702,7 +1702,7 @@ sub GetMarcAuthors { push @link_loop, { limit => 'au', 'link' => $linkvalue, - operator => (scalar @link_loop) ? ' and ' : undef + operator => (scalar @link_loop) ? ' AND ' : undef }; } my @this_link_loop = @link_loop; @@ -1840,7 +1840,7 @@ sub GetMarcSeries { push @link_loop, { 'link' => $linkvalue, - operator => (scalar @link_loop) ? ' and ' : undef + operator => (scalar @link_loop) ? ' AND ' : undef }; if ($volume_number) { diff --git a/C4/Heading.pm b/C4/Heading.pm index c58b507fef..db62c671db 100644 --- a/C4/Heading.pm +++ b/C4/Heading.pm @@ -202,14 +202,14 @@ sub _search { if ($index) { push @marclist, $index; - push @and_or, 'and'; + push @and_or, 'AND'; push @operator, $self->{'match_type'}; push @value, $self->{'search_form'}; } # if ($self->{'thesaurus'}) { # push @marclist, 'thesaurus'; - # push @and_or, 'and'; + # push @and_or, 'AND'; # push @excluding, ''; # push @operator, 'is'; # push @value, $self->{'thesaurus'}; diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl index ccadc9cac6..cb58d946c8 100755 --- a/cataloguing/value_builder/marc21_linking_section.pl +++ b/cataloguing/value_builder/marc21_linking_section.pl @@ -172,7 +172,7 @@ my $launcher = sub { my $startfrom = $query->param('startfrom'); my $resultsperpage = $query->param('resultsperpage') || 20; my $orderby; - my $op = 'and'; + my $op = 'AND'; my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index 259a903817..ecb88f9780 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -359,7 +359,7 @@ sub plugin { my $startfrom = $query->param('startfrom'); my $resultsperpage = $query->param('resultsperpage') || 20; my $orderby; - my $op = 'and'; + my $op = 'AND'; $search = 'kw:'.$search." $op mc-itemtype:".$itype if $itype; my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat($search, $startfrom * $resultsperpage, $resultsperpage ); diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 6ab4b3fcf4..921566dff5 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -600,7 +600,7 @@ sub build_query { my $string = build_simplequery($matchingpoint,$record); push @searchstrings,$string if (length($string)>0); } - my $op = 'and'; + my $op = 'AND'; return join(" $op ",@searchstrings); } sub build_simplequery { @@ -616,7 +616,7 @@ sub build_simplequery { } } } - my $op = 'and'; + my $op = 'AND'; return join(" $op ",@searchstrings); } sub report_item_errors { diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index 743fe512f6..5821a0657b 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -92,7 +92,7 @@ if ( $op eq "do_search" && $query ) { # add the limits if applicable my $itemtypelimit = $input->param('itemtypelimit'); my $ccodelimit = $input->param('ccodelimit'); - my $op = 'and'; + my $op = 'AND'; $query .= " $op $itype_or_itemtype:$itemtypelimit" if $itemtypelimit; $query .= " $op ccode:$ccodelimit" if $ccodelimit; $debug && warn $query; -- 2.20.1