[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. e7db1d05e10d965c9515a7941d517ce541362ef2
Evergreen Git
git at git.evergreen-ils.org
Tue Aug 23 14:27:45 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 e7db1d05e10d965c9515a7941d517ce541362ef2 (commit)
from 282adfc24a0b5171cd0af91e670ed9f6af7e8f88 (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 e7db1d05e10d965c9515a7941d517ce541362ef2
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/OpenILS/Application/Storage/QueryParser.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm
index a7e2eff..8f115f7 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm
@@ -465,11 +465,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:
.../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