Bug 36879: Spurious warning in QueryBuilder

Test plan:

With ElasticSearch enabled,
* Perform a search using the default  sort order
  (i.e. 'relevance').
* Verify that no warnings are generated in
  plack-intranet-error.log

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Andreas Jonsson 2024-05-16 09:38:09 +02:00 committed by wainuiwitikapark
parent 0daebadf04
commit 85ae71cfd4

View file

@ -730,10 +730,11 @@ sub _convert_sort_fields {
# Convert the fields and orders, drop anything we don't know about. # Convert the fields and orders, drop anything we don't know about.
grep { $_->{field} } map { grep { $_->{field} } map {
my ( $f, $d ) = /(.+)_(.+)/; my ( $f, $d ) = /(.+)_(.+)/;
defined $f && defined $d ?
{ {
field => $sort_field_convert{$f}, field => $sort_field_convert{$f},
direction => $sort_order_convert{$d} direction => $sort_order_convert{$d}
} } : { field => undef };
} @sort_by; } @sort_by;
} }