[Groonga-commit] ranguba/rroonga at c2d02b5 [master] test: use inverted index

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Feb 24 17:46:00 JST 2014


Kouhei Sutou	2014-02-24 17:46:00 +0900 (Mon, 24 Feb 2014)

  New Revision: c2d02b5c1c1bf871f66d7217254b68e2059f1a21
  https://github.com/ranguba/rroonga/commit/c2d02b5c1c1bf871f66d7217254b68e2059f1a21

  Message:
    test: use inverted index

  Modified files:
    test/test-index-column.rb

  Modified: test/test-index-column.rb (+17 -8)
===================================================================
--- test/test-index-column.rb    2014-02-24 17:42:15 +0900 (3937550)
+++ test/test-index-column.rb    2014-02-24 17:46:00 +0900 (9f6b9fa)
@@ -55,15 +55,24 @@ class IndexColumnTest < Test::Unit::TestCase
   class CRUDTest < self
     setup
     def setup_schema
-      @articles = Groonga::Array.create(:name => "Articles")
-      @articles.define_column("content", "Text")
+      Groonga::Schema.define do |schema|
+        schema.create_table("Articles") do |table|
+          table.text("content")
+        end
 
-      terms = Groonga::Hash.create(:name => "Terms",
-                                   :key_type => "ShortText",
-                                   :default_tokenizer => "TokenBigram")
-      @index = terms.define_index_column("content", @articles,
-                                         :with_position => true,
-                                         :with_section => true)
+        schema.create_table("Terms",
+                            :type => :hash,
+                            :key_type => "ShortText",
+                            :default_tokenizer => "TokenBigram") do |table|
+          table.index("Articles.content",
+                      :name => "articles_content",
+                      :with_position => true,
+                      :with_section => true)
+        end
+      end
+
+      @articles = Groonga["Articles"]
+      @index = Groonga["Terms.articles_content"]
     end
 
     def test_add
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index