[Rt-commit] rt branch, 4.0/fulltext-search, updated. rt-4.0.0-193-g0c3013f

Shawn Moore sartak at bestpractical.com
Thu May 5 16:31:47 EDT 2011


The branch, 4.0/fulltext-search has been updated
       via  0c3013f00fe2af4ae8f517c964a6299f276bf618 (commit)
      from  45224b8941994098c349a14b0e1fc1c7de3eee9e (commit)

Summary of changes:
 t/fts/indexed_pg.t |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 0c3013f00fe2af4ae8f517c964a6299f276bf618
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu May 5 16:31:27 2011 -0400

    Tests for Pg fulltext word stemming (searching for "books" finds "book")

diff --git a/t/fts/indexed_pg.t b/t/fts/indexed_pg.t
index 9789ba5..005362a 100644
--- a/t/fts/indexed_pg.t
+++ b/t/fts/indexed_pg.t
@@ -10,7 +10,7 @@ my ($major, $minor) = $RT::Handle->dbh->get_info(18) =~ /^0*(\d+)\.0*(\d+)/;
 plan skip_all => "Need Pg 8.2 or higher; we have $major.$minor"
     if "$major.$minor" < 8.2;
 
-plan tests => 11;
+plan tests => 15;
 
 RT->Config->Set( FullTextSearch => Enable => 1, Indexed => 1, Column => 'ContentIndex', Table => 'Attachments' );
 
@@ -74,16 +74,20 @@ sub run_test {
 @tickets = RT::Test->create_tickets(
     { Queue => $q->id },
     { Subject => 'fts test 1', Content => 'book' },
-    { Subject => 'fts test 2', Content => 'bar'  },
+    { Subject => 'fts test 2', Content => 'bars'  },
 );
 sync_index();
 
 my $book = $tickets[0];
-my $bar  = $tickets[1];
+my $bars = $tickets[1];
 
 run_tests(
-    "Content LIKE 'book'" => { $book->id => 1, $bar->id => 0 },
-    "Content LIKE 'bar'"  => { $book->id => 0, $bar->id => 1 },
+    "Content LIKE 'book'" => { $book->id => 1, $bars->id => 0 },
+    "Content LIKE 'bars'" => { $book->id => 0, $bars->id => 1 },
+
+    # make sure that Pg stemming works
+    "Content LIKE 'books'" => { $book->id => 1, $bars->id => 0 },
+    "Content LIKE 'bar'"   => { $book->id => 0, $bars->id => 1 },
 );
 
 @tickets = ();

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


More information about the Rt-commit mailing list