From beed97eec905204e56c2a5bdee60ce6ab1b391f9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 25 Mar 2026 11:18:13 +0000 Subject: [PATCH] Bug 28884: (QA follow-up) Add some missing pod Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit cc0e314f72516832c814a342f21e295b1a3adf7f) Signed-off-by: Jacob O'Mara --- .../Elasticsearch/QueryBuilder.pm | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index 898fcd9956..37058bec51 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -778,6 +778,19 @@ sub _convert_sort_fields { } @sort_by; } +=head2 _convert_index_fields + + my ($conv) = $self->_convert_index_fields($field); + +Converts the zebra-style sort index information into elasticsearch-style. + + Convert according to our table, drop anything that doesn't convert. + If a field starts with mc- we save it as it's used (and removed) later + when joining things, to indicate we make it an 'OR' join. + (Sorry, this got a bit ugly after special cases were found.) + +=cut + sub _convert_index_fields { my ( $self, @indexes ) = @_; @@ -785,10 +798,6 @@ sub _convert_index_fields { @indexes = grep { $_ ne q{} } @indexes; # Remove any blank indexes, i.e. keyword - # Convert according to our table, drop anything that doesn't convert. - # If a field starts with mc- we save it as it's used (and removed) later - # when joining things, to indicate we make it an 'OR' join. - # (Sorry, this got a bit ugly after special cases were found.) map { # Lower case all field names my ( $f, $t ) = map( lc, split /,/ ); @@ -1516,6 +1525,14 @@ sub _is_safe_to_auto_truncate { return 1; } +=head2 _rebuild_to_es_advanced_query + + $res = _rebuild_to_es_advanced_query( $res ); + +Passed in a query, this function converts a geolocation query into the necessary format for Elasticsearch + +=cut + sub _rebuild_to_es_advanced_query { my ($res) = @_; my $query_string = $res->{query}->{query_string};