From a366d1746fb481b5f43d87875ab5167e83af3f6e 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 Signed-off-by: Fridolin Somers Signed-off-by: Katrin Fischer --- C4/Biblio.pm | 4 ++-- C4/Heading.pm | 4 ++-- C4/Search.pm | 2 +- Koha/Biblio.pm | 2 +- 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 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index ce2b949554..48cdf473ec 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1633,7 +1633,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; @@ -1771,7 +1771,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 67ddcfd46a..4d67cd5624 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/C4/Search.pm b/C4/Search.pm index 18a2977a97..6cf40b67b3 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1585,7 +1585,7 @@ sub _build_initial_query { my $operator = ""; if ($params->{previous_operand}){ #If there is a previous operand, add a supplied operator or the default 'and' - $operator = ($params->{operator}) ? " ".($params->{operator})." " : ' and '; + $operator = ($params->{operator}) ? " ".($params->{operator})." " : ' AND '; } #NOTE: indexes_set is typically set when doing truncation or field weighting diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index a259db4bb7..c4874a859a 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1038,7 +1038,7 @@ sub get_marc_authors { 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; diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl index 448dd4ee4b..8206e70a4e 100755 --- a/cataloguing/value_builder/marc21_linking_section.pl +++ b/cataloguing/value_builder/marc21_linking_section.pl @@ -168,7 +168,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 565290cd89..21f284df7c 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -337,7 +337,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 63409e7964..d2dfe1ad56 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -592,7 +592,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 { @@ -608,7 +608,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 d38147d8c1..8791f037da 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -89,7 +89,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; $resultsperpage = $input->param('resultsperpage'); -- 2.30.2