[open-ils-commits] [GIT] Evergreen ILS branch rel_2_8 updated. 17fd0961e7ff9a0a8e9543a6f94d0be2058bfc36

Evergreen Git git at git.evergreen-ils.org
Wed Nov 18 13:49:30 EST 2015


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_8 has been updated
       via  17fd0961e7ff9a0a8e9543a6f94d0be2058bfc36 (commit)
      from  21733c3b0fbb618ea5ded5156312f10f57874980 (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 17fd0961e7ff9a0a8e9543a6f94d0be2058bfc36
Author: Mike Rylander <mrylander at gmail.com>
Date:   Tue Nov 17 17:20:05 2015 -0500

    LP#1516707: Phrase search ignores CD modifiers
    
    Because phrases are subqueries, we need to look at the top of the parse tree
    when looking for modifiers for cover density.  This is because modifers are
    normally only allowed at the top of the parse tree (or in the floating sub-
    query).  We do that by asking the plan's QueryParse for it's reference to its
    parse_tree member, which is always the top of the parse tree in QP.
    
    Included in this commit is a small change to the QP testing script to
    facilitate testing of this fix.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/extras/fts-replacement.pl b/Open-ILS/src/extras/fts-replacement.pl
index c18f2e8..dcca275 100755
--- a/Open-ILS/src/extras/fts-replacement.pl
+++ b/Open-ILS/src/extras/fts-replacement.pl
@@ -18,6 +18,10 @@ my $query = '#available title: foo bar* || (-baz || (subject:"1900'.
                         'strategy(exclusion) item_type(a, t) item_form(d) '.
                         'bib.subjectTitle=potter bib.subjectName=harry '.
                         'keyword|mapscale:1:250000';
+
+# For testing LP#1516707
+# $query = '#CD_documentLength #CD_meanHarmonic #CD_uniqueWords core_limit(10000) limit(1000) estimation_strategy(inclusion)  keyword: title:"the blue" depth(0)';
+
 my $superpage = 1;
 my $superpage_size = 1000;
 my $core_limit = 25000;
@@ -36,12 +40,15 @@ GetOptions(
 );
 
 
+OpenILS::Application::Storage::Driver::Pg::QueryParser->initialize;
+
 my $start = time();
 OpenILS::Application::Storage::Driver::Pg::QueryParser->new( superpage_size => $superpage_size, superpage => $superpage, core_limit => $core_limit, debug => $debug, query => $query )->parse->parse_tree for (1 .. $runs);
 my $end = time();
 
 my $plan = OpenILS::Application::Storage::Driver::Pg::QueryParser->new( superpage_size => $superpage_size, superpage => $superpage, core_limit => $core_limit, query => $query, debug => $debug );
 $plan->parse;
+print "Parser config:\n" .  Dumper( \%QueryParser::parser_config) if (!$quiet);
 print "Parsed query tree:\n" .  Dumper( $plan->parse_tree) if (!$quiet);
 #print "Parsed query tree:\n" .  Dumper( QueryParser->new( superpage_size => $superpage_size, superpage => $superpage, core_limit => $core_limit, query => $query, debug => $debug )->parse->parse_tree);
 my $sql = $plan->toSQL;
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 84fdbee..f08b1e5 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
@@ -1526,7 +1526,7 @@ sub rank {
 
     my $cover_density = 0;
     for my $norm ( keys %$rank_norm_map) {
-        $cover_density += $$rank_norm_map{$norm} if ($self->plan->find_modifier($norm));
+        $cover_density += $$rank_norm_map{$norm} if ($self->plan->QueryParser->parse_tree->find_modifier($norm));
     }
 
     my $weights = join(', ', @{$self->plan->QueryParser->search_class_weights($self->classname)});

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/extras/fts-replacement.pl             |    7 +++++++
 .../Application/Storage/Driver/Pg/QueryParser.pm   |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list