[Groonga-commit] groonga/fluent-plugin-droonga at 93130ef [master] Enable "default_tokenizer" parameter to "table_create" command

Back to archive index

Kosuke Asami null+****@clear*****
Thu Jul 11 13:29:14 JST 2013


Kosuke Asami	2013-07-11 13:29:14 +0900 (Thu, 11 Jul 2013)

  New Revision: 93130ef92549ba31893171665a524c45136c2c0a
  https://github.com/groonga/fluent-plugin-droonga/commit/93130ef92549ba31893171665a524c45136c2c0a

  Message:
    Enable "default_tokenizer" parameter to "table_create" command

  Modified files:
    lib/droonga/plugin/groonga/table_create.rb
    test/plugin/groonga/test_table_create.rb

  Modified: lib/droonga/plugin/groonga/table_create.rb (+6 -0)
===================================================================
--- lib/droonga/plugin/groonga/table_create.rb    2013-07-11 13:07:07 +0900 (fe2ba09)
+++ lib/droonga/plugin/groonga/table_create.rb    2013-07-11 13:29:14 +0900 (03c600f)
@@ -39,6 +39,7 @@ module Droonga
         parse_flags(options, request)
         parse_key_type(options, request)
         parse_value_type(options, request)
+        parse_default_tokenizer(options, request)
         options
       end
 
@@ -75,6 +76,11 @@ module Droonga
         options[:value_type] = request["value_type"] if request["value_type"]
         options
       end
+
+      def parse_default_tokenizer(options, request)
+        options[:default_tokenizer] = request["default_tokenizer"] if request["default_tokenizer"]
+        options
+      end
     end
   end
 end

  Modified: test/plugin/groonga/test_table_create.rb (+13 -0)
===================================================================
--- test/plugin/groonga/test_table_create.rb    2013-07-11 13:07:07 +0900 (1e1a167)
+++ test/plugin/groonga/test_table_create.rb    2013-07-11 13:29:14 +0900 (b7e6a2f)
@@ -119,4 +119,17 @@ table_create Books TABLE_HASH_KEY --key_type ShortText --value_type Int32
       SCHEMA
     end
   end
+
+  class DefaultTokenizerTest < self
+    def test_default_tokenizer
+      request = {
+        "name"  => "Books",
+        "default_tokenizer" => "TokenBigram",
+      }
+      @handler.table_create(request)
+      assert_equal(<<-SCHEMA, dump)
+table_create Books TABLE_HASH_KEY --key_type ShortText --default_tokenizer TokenBigram
+      SCHEMA
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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