[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. fffe9d65e508dc998356de104f5a372857e167b6
Evergreen Git
git at git.evergreen-ils.org
Tue Aug 23 14:28:16 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_1 has been updated
via fffe9d65e508dc998356de104f5a372857e167b6 (commit)
from 30a4589afe26087ef163ca35f2fb6564db769225 (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 fffe9d65e508dc998356de104f5a372857e167b6
Author: Liam Whalen <lwhalen at evergreen-dev.catalogue.nrcan.gc.ca>
Date: Thu Aug 11 14:36:19 2011 -0400
Fixed seaching for a colon (:) surrounded by white space
When searching for a colon surrounded by white space the search would
freeze. An example of such a search would be:
Climate change economics and policy : an RFF anthology
This was happening because the decompose function within QueryParser.pm
Would build a regular expression that would search the query for both
classes and class aliases e.g (keyword and kw). However, when buliding
the regex for aliases QueryParser would add extraneous or symbols (|)
to the end of the regex without adding the accompanying alias.
This was happening because there was a check to see if the corresponding
class to each alias had already been added to the regex. But, the
check to see if the alias had already been appened to the regex happened
too late. I have moved the check to encopase the appending of the or
symbols and the class.
Signed-off-by: Liam Whalen <lwhalen at evergreen-dev.catalogue.nrcan.gc.ca>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
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 1b3a37f..db9dd98 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
@@ -497,11 +497,13 @@ sub decompose {
s/(^|[^|])\b$alias[:=]/$1$class:/g;
}
- $search_class_re .= '|' unless ($first_class);
- $first_class = 0;
+ if (!$seen_classes{$class}) {
+ $search_class_re .= '|' unless ($first_class);
+ $first_class = 0;
- $search_class_re .= $class . '(?:\|\w+)*' if (!$seen_classes{$class});
- $seen_classes{$class} = 1;
+ $search_class_re .= $class . '(?:\|\w+)*';
+ $seen_classes{$class} = 1;
+ }
}
$search_class_re .= '):';
-----------------------------------------------------------------------
Summary of changes:
.../lib/OpenILS/Application/Storage/QueryParser.pm | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list