It's possible to send invalid parameters to the
search.highlight_display_fields function which
wastes a db roundtrip and fills the logs with
errors. Checking to be sure there's anything in
the parameter will prevent both.
Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
return;
}
- my $hl_map_string = "''::HSTORE";
+ my $hl_map_string = "";
if (ref($highlight_map) =~ /HASH/) {
- $hl_map_string = "";
for my $tsq (keys %$highlight_map) {
my $field_list = join(',', @{$$highlight_map{$tsq}});
$hl_map_string .= ' || ' if $hl_map_string;
my $e = new_editor();
for my $record ( @records ) {
- next unless $record;
+ next unless ($record && $hl_map_string);
$conn->respond(
$e->json_query(
{from => ['search.highlight_display_fields', $record, $hl_map_string]}