[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. c10d22a43849bb3c142c691860c28f311ef34f67

Evergreen Git git at git.evergreen-ils.org
Tue May 14 16:02:31 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, rel_2_4 has been updated
       via  c10d22a43849bb3c142c691860c28f311ef34f67 (commit)
      from  a46c410a1a3295b407a4b01416edf1189c37bdf1 (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 c10d22a43849bb3c142c691860c28f311ef34f67
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