[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. 78f260007cb477717d793f77e47257c44c4979c0
Evergreen Git
git at git.evergreen-ils.org
Thu Nov 3 09:17:38 EDT 2011
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_0 has been updated
via 78f260007cb477717d793f77e47257c44c4979c0 (commit)
from 2bb0bc648086892731f5d8159d16eec4922fb5e5 (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 78f260007cb477717d793f77e47257c44c4979c0
Author: Mike Rylander <mrylander at gmail.com>
Date: Wed Nov 2 15:53:56 2011 -0400
2.0-ification of the phrase-search fix for LP#834042
Signed-off-by: Mike Rylander <mrylander at gmail.com>
Signed-off-by: Bill Erickson <berick at esilibrary.com>
diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm
index 8f115f7..69f9a8a 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm
@@ -435,6 +435,7 @@ sub decompose {
my $current_class = shift || $self->default_search_class;
my $recursing = shift || 0;
+ my $phrase_helper = shift || 0;
# Build the search class+field uber-regexp
my $search_class_re = '^\s*(';
@@ -609,12 +610,22 @@ sub decompose {
} elsif (/^\s*"([^"]+)"/) { # phrase, always anded
warn "Encountered phrase: $1\n" if $self->debug;
- $struct->joiner( '&' );
my $phrase = $1;
- my $class_node = $struct->classed_node($current_class);
- $class_node->add_phrase( $phrase );
- $_ = $phrase . $';
+ if (!$phrase_helper) {
+ warn "Recursing into decompose with the phrase as a subquery\n" if $self->debug;
+ my $after = $';
+ my ($substruct, $subremainder) = $self->decompose( qq/"$phrase"/, $current_class, $recursing + 1, 1 );
+ $struct->add_node( $substruct ) if ($substruct);
+ $_ = $after;
+ } else {
+ warn "Directly parsing the phrase subquery\n" if $self->debug;
+ $struct->joiner( '&' );
+
+ my $class_node = $struct->classed_node($current_class);
+ $class_node->add_phrase( $phrase );
+ $_ = $phrase . $';
+ }
$last_type = '';
} elsif (/$required_re([^\s)]+)/) { # phrase, always anded
-----------------------------------------------------------------------
Summary of changes:
.../OpenILS/Application/Storage/QueryParser.pm | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list