Kosuke Asami
null+****@clear*****
Thu Jul 11 13:32:40 JST 2013
Kosuke Asami 2013-07-11 13:32:40 +0900 (Thu, 11 Jul 2013) New Revision: a4ec58aec1787741080cf788b1597eba73ae4470 https://github.com/groonga/fluent-plugin-droonga/commit/a4ec58aec1787741080cf788b1597eba73ae4470 Message: Enable "normalizer" 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:29:14 +0900 (03c600f) +++ lib/droonga/plugin/groonga/table_create.rb 2013-07-11 13:32:40 +0900 (c545300) @@ -40,6 +40,7 @@ module Droonga parse_key_type(options, request) parse_value_type(options, request) parse_default_tokenizer(options, request) + parse_normalizer(options, request) options end @@ -81,6 +82,11 @@ module Droonga options[:default_tokenizer] = request["default_tokenizer"] if request["default_tokenizer"] options end + + def parse_normalizer(options, request) + options[:normalizer] = request["normalizer"] if request["normalizer"] + 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:29:14 +0900 (b7e6a2f) +++ test/plugin/groonga/test_table_create.rb 2013-07-11 13:32:40 +0900 (eee4b58) @@ -132,4 +132,17 @@ table_create Books TABLE_HASH_KEY --key_type ShortText --default_tokenizer Token SCHEMA end end + + class NormalizerTest < self + def test_default_tokenizer + request = { + "name" => "Books", + "normalizer" => "NormalizerAuto", + } + @handler.table_create(request) + assert_equal(<<-SCHEMA, dump) +table_create Books TABLE_HASH_KEY|KEY_NORMALIZE --key_type ShortText + SCHEMA + end + end end -------------- next part -------------- HTML����������������������������...Download