Kosuke Asami
null+****@clear*****
Tue Jul 16 15:16:36 JST 2013
Kosuke Asami 2013-07-16 15:16:36 +0900 (Tue, 16 Jul 2013) New Revision: ddd3a2355c2c026635bd57c5b4c3880c22239ca6 https://github.com/groonga/fluent-plugin-droonga/commit/ddd3a2355c2c026635bd57c5b4c3880c22239ca6 Message: column_create: support "flags" parameter for index-type column Modified files: lib/droonga/plugin/groonga/column_create.rb test/plugin/groonga/test_column_create.rb Modified: lib/droonga/plugin/groonga/column_create.rb (+8 -0) =================================================================== --- lib/droonga/plugin/groonga/column_create.rb 2013-07-16 15:15:48 +0900 (4cec3fb) +++ lib/droonga/plugin/groonga/column_create.rb 2013-07-16 15:16:36 +0900 (b63206e) @@ -84,12 +84,20 @@ module Droonga def create_index_options options = {} create_index_options_name(options) + create_index_options_flags(options) options end def create_index_options_name(options) options[:name] = @command["name"] end + + def create_index_options_flags(options) + options[:with_section] = true if****@comma*****_section? + options[:with_weight] = true if****@comma*****_weight? + options[:with_position] = true if****@comma*****_position? + options + end end end end Modified: test/plugin/groonga/test_column_create.rb (+24 -0) =================================================================== --- test/plugin/groonga/test_column_create.rb 2013-07-16 15:15:48 +0900 (6da3ca6) +++ test/plugin/groonga/test_column_create.rb 2013-07-16 15:16:36 +0900 (108969f) @@ -72,6 +72,30 @@ column_create Books title COLUMN_VECTOR ShortText column_create Books entry_title COLUMN_INDEX Books title SCHEMA }, + "WITH_SECTION" => { + :flags => "COLUMN_INDEX|WITH_SECTION", + :schema => <<-SCHEMA, +column_create Books entry_title COLUMN_INDEX|WITH_SECTION Books title + SCHEMA + }, + "WITH_WEIGHT" => { + :flags => "COLUMN_INDEX|WITH_WEIGHT", + :schema => <<-SCHEMA, +column_create Books entry_title COLUMN_INDEX|WITH_WEIGHT Books title + SCHEMA + }, + "WITH_POSITION" => { + :flags => "COLUMN_INDEX|WITH_POSITION", + :schema => <<-SCHEMA, +column_create Books entry_title COLUMN_INDEX|WITH_POSITION Books title + SCHEMA + }, + "COLUMN_INDEX with all" => { + :flags => "COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION", + :schema => <<-SCHEMA, +column_create Books entry_title COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION Books title + SCHEMA + }, }) def test_index_flags(data) request = { -------------- next part -------------- HTML����������������������������... Télécharger