Bug 31652: Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Katrin Fischer 2024-04-29 12:46:39 +00:00
parent 4bed77da08
commit 27c496a50d
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 12 additions and 15 deletions

View file

@ -741,13 +741,13 @@ sub marc_records_to_documents {
}
}
foreach my $field (@{$rules->{geo_point}}) {
foreach my $field ( @{ $rules->{geo_point} } ) {
next unless $record_document->{$field};
my $geofield = $field;
$geofield =~ s/_(lat|lon)$//;
my $axis = $1;
my $vals = $record_document->{$field};
for my $i (0 .. @$vals - 1) {
for my $i ( 0 .. @$vals - 1 ) {
my $val = $record_document->{$field}[$i];
$record_document->{$geofield}[$i]{$axis} = $val;
}

View file

@ -936,10 +936,10 @@ sub _create_query_string {
$es_advanced_searches = [];
my @string_queries;
foreach my $q (@queries) {
if ($q->{field} && $q->{field} eq 'geolocation') {
push(@$es_advanced_searches, $q);
if ( $q->{field} && $q->{field} eq 'geolocation' ) {
push( @$es_advanced_searches, $q );
} else {
push(@string_queries, $q)
push( @string_queries, $q );
}
}
@ -1428,27 +1428,24 @@ sub _rebuild_to_es_advanced_query {
my %filter;
for my $advanced_query (@$es_advanced_searches) {
if ( $advanced_query->{field} eq 'geolocation') {
my ($lat, $lon, $distance) = map { $_ =~ /:(.*)\*/ } split('\s+', $advanced_query->{operand});
if ( $advanced_query->{field} eq 'geolocation' ) {
my ( $lat, $lon, $distance ) = map { $_ =~ /:(.*)\*/ } split( '\s+', $advanced_query->{operand} );
$filter{geo_distance} = {
distance => $distance,
distance => $distance,
geolocation => {
lat => $lat,
lon => $lon,
}
};
}
else {
warn "unknown advanced ElasticSearch query: ".join(', ',%$advanced_query);
} else {
warn "unknown advanced ElasticSearch query: " . join( ', ', %$advanced_query );
}
}
$res->{query} = {
bool => {
must => {
query_string => $query_string
},
filter => \%filter,
must => { query_string => $query_string },
filter => \%filter,
}
};