From b800e1637f3f29fffed0009721592c7bba05024e Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 23 Aug 2011 15:03:56 -0400 Subject: [PATCH] Ignore empty atoms in query decomposition Signed-off-by: Mike Rylander Signed-off-by: Thomas Berezansky --- .../src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm index db9dd9839a..b4dc7985dd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm @@ -676,7 +676,7 @@ sub decompose { my $negator = ($atom =~ s/^-//o) ? '!' : ''; my $truncate = ($atom =~ s/\*$//o) ? '*' : ''; - if (!grep { $atom eq $_ } ('&','|')) { # throw away & and |, not allowed in tsquery, and not really useful anyway + if ($atom ne '' and !grep { $atom eq $_ } ('&','|')) { # throw away & and |, not allowed in tsquery, and not really useful anyway my $class_node = $struct->classed_node($current_class); $class_node->add_fts_atom( $atom, suffix => $truncate, prefix => $negator, node => $class_node ); $struct->joiner( '&' ); -- 2.43.2