Masafumi Yokoyama
null+****@clear*****
Wed Jan 6 16:44:44 JST 2016
Masafumi Yokoyama 2016-01-06 16:44:44 +0900 (Wed, 06 Jan 2016) New Revision: 1809010e9d86fed9a060a06893aa24130c27fde5 https://github.com/ranguba/rroonga/commit/1809010e9d86fed9a060a06893aa24130c27fde5 Message: Revert "Bind grn_obj_reindex()" This reverts commit 5147c63459a00737d5e3deb7be44c1089fd0f1a3. Conflicts: ext/groonga/rb-grn-object.c We shouldn't define the method to `Groonga::Object`. It should be defined to each available objects: `Groonga::Database`, `Groonga::Table`, `Groonga::FixSizeColumn`, `Groonga::VariableSizeColumn` and `Groonga::IndexColumn`. Modified files: ext/groonga/rb-grn-object.c test/test-column.rb Modified: ext/groonga/rb-grn-object.c (+0 -35) =================================================================== --- ext/groonga/rb-grn-object.c 2016-01-06 15:32:33 +0900 (ecc4922) +++ ext/groonga/rb-grn-object.c 2016-01-06 16:44:44 +0900 (2f20c25) @@ -1718,39 +1718,6 @@ rb_grn_object_key_accessor_p (VALUE self) return CBOOL2RVAL(key_accessor_p); } -/* - * Recreates one or more index columns. - * - * This method is a useful when your index column is broken. The - * target object is one of database, table and column. - * - * * If target object is a database, all index columns are recreated. - * * If target object is a table, all index columns in the table are recreated. - * * If target object is a data column, all index columns for the data column are recreated. - * * If target object is an index column, the index column is recreated. - * - * @overload reindex - * @return [void] - * - * @since 5.1.1 - */ -static VALUE -rb_grn_object_reindex (VALUE self) -{ - grn_ctx *context; - grn_obj *object; - grn_rc rc; - - rb_grn_object_deconstruct(SELF(self), &object, &context, - NULL, NULL, NULL, NULL); - - rc = grn_obj_reindex(context, object); - rb_grn_context_check(context, self); - rb_grn_rc_check(rc, self); - - return Qnil; -} - void rb_grn_init_object (VALUE mGrn) { @@ -1800,6 +1767,4 @@ rb_grn_init_object (VALUE mGrn) rb_grn_object_accessor_p, 0); rb_define_method(rb_cGrnObject, "key_accessor?", rb_grn_object_key_accessor_p, 0); - - rb_define_method(rb_cGrnObject, "reindex", rb_grn_object_reindex, 0); } Modified: test/test-column.rb (+0 -37) =================================================================== --- test/test-column.rb 2016-01-06 15:32:33 +0900 (662e52a) +++ test/test-column.rb 2016-01-06 16:44:44 +0900 (17d03ea) @@ -348,43 +348,6 @@ class ColumnTest < Test::Unit::TestCase end end - def test_reindex - Groonga::Schema.define do |schema| - schema.create_table("Memos", - :type => :array) do |table| - table.column("content", "Text") - end - schema.create_table("Terms", - :type => :patricia_trie, - :key_type => "ShortText", - :default_tokenizer => "TokenBigram", - :normalizer => "NormalizerAuto") do |table| - table.index("Memos.content") - end - end - - memos = Groonga["Memos"] - memos.add(:content => "This is a memo") - - terms = Groonga["Terms"] - terms.delete("this") - assert_equal([ - "a", - "is", - "memo", - ], - terms.collect(&:_key).sort) - - memos.column(:content).reindex - assert_equal([ - "a", - "is", - "memo", - "this", - ], - terms.collect(&:_key).sort) - end - private def assert_content_search(expected_records, term) records = @bookmarks_index_content.search(term).records -------------- next part -------------- HTML����������������������������...Download