[open-ils-commits] [GIT] Evergreen ILS branch master updated. e3b249bcca7eae1b79bd75bdcd88388bb38e1874

Evergreen Git git at git.evergreen-ils.org
Tue May 14 16:02:11 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  e3b249bcca7eae1b79bd75bdcd88388bb38e1874 (commit)
      from  919f3bb1d16cca586299e745ce6bfdeeee9b8c98 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e3b249bcca7eae1b79bd75bdcd88388bb38e1874
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Tue May 14 15:33:54 2013 -0400

    LP#118066: fix searches that failed because punctuation was a token in query
    
    When building the text array literal to pass to evergreen.rel_bump,
    make sure that tokens that get {search_}normalize{d} away
    don't result in syntax errors.
    
    With this patch, searches like the following will work again:
    
    keyword:Take me to the river / Al Green and Mabon
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
index c202dac..4fcbe5e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
@@ -904,9 +904,9 @@ sub flatten {
 
                 if(scalar @bumps > 0 && scalar @{$node->only_positive_atoms} > 0) {
                     # Note: Previous rank function used search_normalize outright. Duplicating that here.
-                    $node_rank .= "\n" . ${spc} x 5 . "* evergreen.rel_bump(('{' || search_normalize(";
-                    $node_rank .= join(") || ',' || search_normalize(",map { $self->QueryParser->quote_phrase_value($_->content) } @{$node->only_positive_atoms});
-                    $node_rank .= ") || '}')::TEXT[], " . $node->table_alias . ".value, '{" . join(",", at bumps) . "}'::TEXT[], '{" . join(",", at bumpmults) . "}'::NUMERIC[])";
+                    $node_rank .= "\n" . ${spc} x 5 . "* evergreen.rel_bump(('{' || quote_literal(search_normalize(";
+                    $node_rank .= join(")) || ',' || quote_literal(search_normalize(",map { $self->QueryParser->quote_phrase_value($_->content) } @{$node->only_positive_atoms});
+                    $node_rank .= ")) || '}')::TEXT[], " . $node->table_alias . ".value, '{" . join(",", at bumps) . "}'::TEXT[], '{" . join(",", at bumpmults) . "}'::NUMERIC[])";
                 }
 
                 my $NOT = '';

-----------------------------------------------------------------------

Summary of changes:
 .../Application/Storage/Driver/Pg/QueryParser.pm   |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list