[open-ils-commits] r15922 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Mar 21 14:17:27 EDT 2010


Author: miker
Date: 2010-03-21 14:17:22 -0400 (Sun, 21 Mar 2010)
New Revision: 15922

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
Log:
add phrase cross-checking

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm	2010-03-19 21:00:58 UTC (rev 15921)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm	2010-03-21 18:17:22 UTC (rev 15922)
@@ -542,10 +542,14 @@
                 }
 
                 my $core_limit = $self->QueryParser->core_limit || 25000;
-                $from .= "\n\t\tLIMIT " . $self->QueryParser->core_limit . "\n\t) AS " . $node->table_alias . ' ON (m.source = ' . $node->table_alias . ".source)";
+                $from .= "\n\t\tLIMIT $core_limit\n\t) AS $talias ON (m.source = $talias.source)";
                 $from .= "\n\tJOIN config.metabib_field AS ${talias}_weight ON (${talias}_weight.id = $talias.field)\n";
 
-                $where .= $node->table_alias . ".id IS NOT NULL ";
+                $where .= $talias . ".id IS NOT NULL ";
+                my $phrases = $node->phrases;
+                if (@$phrases) {
+                    $where .= ' AND (' . join(' AND ', map {"$talias.value ~ \$_$$\$$_\$_$$\$"} @$phrases) . ')';;
+                }
 
                 push @rank_list, $node_rank;
 



More information about the open-ils-commits mailing list