Masafumi Yokoyama
yokoy****@clear*****
Wed Jan 6 18:41:05 JST 2016
@see も使えそうです。 https://github.com/ranguba/rroonga/pull/113/files#r48940268 On 2016年01月06日 18:34, Masafumi Yokoyama wrote: > >> もしも無いなら、 > >> > >>> But this+ * method spends more time rather than you specify only > reindex+ * needed index columns. > >>> > >> > >> の行は削ってしまうとか。 > > 以下の文を追加するのはどうでしょうか。 > > Use `Groonga::Table`, `Groonga::FixSizeColumn`, > `Groonga::VariableSizeColumn` or `Groonga::IndexColumn` if you need to > narrow down index columns. > > > On 2016年01月06日 18:27, Masafumi Yokoyama wrote: >> インラインでコメントします。 >> >> On 2016年01月06日 18:18, Hiroshi Hatake wrote: >>> そういえば、コメントを見ていて疑問に感じたのですが、 >>> >>>> You don't need to specify each index column. But this+ * method >>>> spends more time rather than you specify only reindex+ * needed >>>> index columns. >>>> >>> >>> と書いているので、 >>> 実はインデックスの再作成が必要なカラム(の文字列?シンボル?)を引数に取 >>> る事もできるメソッドにした方が良いとかありますか? >> >> 引数に取ることはできませんが、カラムオブジェクトにもreindexメソッドがあ >> るので、 >> それを使えば再作成が必要なカラムのみを対象にすることは可能です。 >> >>> もしも無いなら、 >>> >>>> But this+ * method spends more time rather than you specify only >>>> reindex+ * needed index columns. >>>> >>> >>> の行は削ってしまうとか。 >> >> 前述の通り対象を絞ることができるので、上記の行があってもよいと思うので >> すが、 >> どうでしょうか。 >> >> >>> 指定出来る必要があるなら、コメントの最初は >>> >>>> + * Recreates all index columns in the table. >>>> >>> >>> ではなく、 >>> >>> Recreate all or specified index columns in the table. >>> >>> としてみるのはどうでしょうか? >>> >>> -- >>> Hiroshi Hatake <hatake �� clear-code.com <mailto:hatake �� clear-code.com>> >>> >>> >>> >>> 2016/01/06 18:07、Masafumi Yokoyama <null+groonga �� clear-code.com >>> <mailto:null+groonga �� clear-code.com>> のメール: >>> >>>> Author >>>> Masafumi Yokoyama <yokoyama �� clear-code.com >>>> <mailto:yokoyama �� clear-code.com>> >>>> Date >>>> 2016-01-06 18:07:09 +0900 (Wed, 06 Jan 2016) >>>> New Revision >>>> f67013037a2ce655057c4e5880a529b67f9b881c >>>> >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c> >>>> >>>> Message >>>> Add Groonga::Table#reindex to bind grn_obj_reindex() >>>> >>>> GitHub:#110 <https://github.com/ranguba/rroonga/issues/110> >>>> Modified files >>>> >>>> * ext/groonga/rb-grn-table.c >>>> >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33c> >>>> >>>> * test/test-table.rb >>>> >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859a> >>>> >>>> >>>> Modified: ext/groonga/rb-grn-table.c (+57 -1) >>>> =================================================================== >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33c> >>>> >>>> 1 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL1> >>>> >>>> 2 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2> >>>> >>>> 3 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL3> >>>> >>>> 4 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL4> >>>> >>>> >>>> 5 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL5> >>>> >>>> 6 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL6> >>>> >>>> 7 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL7> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2677> >>>> >>>> 2678 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2678> >>>> >>>> 2679 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2679> >>>> >>>> 2680 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2680> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> 2681 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2681> >>>> >>>> 2682 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2682> >>>> >>>> 2683 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2683> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2764> >>>> >>>> 2765 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2765> >>>> >>>> 2766 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2766> >>>> >>>> 2767 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2767> >>>> >>>> >>>> >>>> 2768 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2768> >>>> >>>> 2769 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2769> >>>> >>>> 2770 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cL2770> >>>> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33c> >>>> >>>> 1 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR1> >>>> >>>> 2 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2> >>>> >>>> >>>> 3 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR3> >>>> >>>> 4 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR4> >>>> >>>> 5 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR5> >>>> >>>> 6 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR6> >>>> >>>> 7 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR7> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2677> >>>> >>>> 2678 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2678> >>>> >>>> 2679 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2679> >>>> >>>> 2680 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2680> >>>> >>>> 2681 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2681> >>>> >>>> 2682 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2682> >>>> >>>> 2683 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2683> >>>> >>>> 2684 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2684> >>>> >>>> 2685 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2685> >>>> >>>> 2686 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2686> >>>> >>>> 2687 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2687> >>>> >>>> 2688 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2688> >>>> >>>> 2689 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2689> >>>> >>>> 2690 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2690> >>>> >>>> 2691 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2691> >>>> >>>> 2692 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2692> >>>> >>>> 2693 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2693> >>>> >>>> 2694 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2694> >>>> >>>> 2695 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2695> >>>> >>>> 2696 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2696> >>>> >>>> 2697 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2697> >>>> >>>> 2698 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2698> >>>> >>>> 2699 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2699> >>>> >>>> 2700 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2700> >>>> >>>> 2701 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2701> >>>> >>>> 2702 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2702> >>>> >>>> 2703 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2703> >>>> >>>> 2704 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2704> >>>> >>>> 2705 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2705> >>>> >>>> 2706 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2706> >>>> >>>> 2707 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2707> >>>> >>>> 2708 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2708> >>>> >>>> 2709 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2709> >>>> >>>> 2710 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2710> >>>> >>>> 2711 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2711> >>>> >>>> 2712 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2712> >>>> >>>> 2713 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2713> >>>> >>>> 2714 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2714> >>>> >>>> 2715 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2715> >>>> >>>> 2716 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2716> >>>> >>>> 2717 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2717> >>>> >>>> 2718 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2718> >>>> >>>> 2719 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2719> >>>> >>>> 2720 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2720> >>>> >>>> 2721 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2721> >>>> >>>> 2722 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2722> >>>> >>>> 2723 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2723> >>>> >>>> 2724 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2724> >>>> >>>> 2725 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2725> >>>> >>>> 2726 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2726> >>>> >>>> 2727 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2727> >>>> >>>> 2728 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2728> >>>> >>>> 2729 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2729> >>>> >>>> 2730 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2730> >>>> >>>> 2731 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2731> >>>> >>>> 2732 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2732> >>>> >>>> 2733 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2733> >>>> >>>> 2734 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2734> >>>> >>>> 2735 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2735> >>>> >>>> 2736 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2736> >>>> >>>> 2737 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2737> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2818> >>>> >>>> 2819 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2819> >>>> >>>> 2820 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2820> >>>> >>>> 2821 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2821> >>>> >>>> 2822 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2822> >>>> >>>> 2823 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2823> >>>> >>>> 2824 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2824> >>>> >>>> 2825 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2825> >>>> >>>> 2826 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-e27562087948683aa67aa619d0afe33cR2826> >>>> >>>> >>>> @@ -1,7 +1,7 @@ >>>> /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; >>>> c-basic-offset: 4 -*- */ >>>> /* >>>> - Copyright (C) 2014-2015 Masafumi Yokoyama >>>> <yokoyama �� clear-code.com <mailto:yokoyama �� clear-code.com>> >>>> Copyright (C) 2009-2015 Kouhei Sutou <kou �� clear-code.com >>>> <mailto:kou �� clear-code.com>> >>>> + Copyright (C) 2014-2016 Masafumi Yokoyama >>>> <yokoyama �� clear-code.com <mailto:yokoyama �� clear-code.com>> >>>> >>>> This library is free software; you can redistribute it and/or >>>> modify it under the terms of the GNU Lesser General Public >>>> @@ -2678,6 +2678,60 @@rb_grn_table_rename (VALUE self, VALUE rb_name) >>>> return self; >>>> } >>>> >>>> +/* >>>> + * Recreates all index columns in the table. >>>> + * >>>> + * This method is useful when you have any broken index columns in >>>> + * the table. You don't need to specify each index column. But this >>>> + * method spends more time rather than you specify only reindex >>>> + * needed index columns. >>>> + * >>>> + * @example How to recreate all index columns in the table >>>> + * Groonga::Schema.define do |schema| >>>> + * schema.create_table("Memos") do |table| >>>> + * table.short_text("title") >>>> + * table.text("content") >>>> + * end >>>> + * >>>> + * schema.create_table("Terms", >>>> + * :type => :patricia_trie, >>>> + * :key_type => :short_text, >>>> + * :normalizer => "NormalizerAuto", >>>> + * :default_tokenizer => "TokenBigram") do >>>> |table| >>>> + * table.index("Memos.title") >>>> + * table.index("Memos.content") >>>> + * end >>>> + * end >>>> + * >>>> + * Groonga["Terms"].reindex >>>> + * # => >>>> + * # Groonga["Terms.Memos_title"].reindex >>>> + * # Groonga["Terms.Memos_content"].reindex >>>> + * >>>> + * @overload reindex >>>> + * @return [void] >>>> + * >>>> + * @since 5.1.1 >>>> + */ >>>> +static VALUE >>>> +rb_grn_table_reindex (VALUE self) >>>> +{ >>>> + grn_rc rc; >>>> + grn_ctx *context; >>>> + grn_obj *table; >>>> + >>>> + rb_grn_table_deconstruct(SELF(self), &table, &context, >>>> + NULL, NULL, NULL, >>>> + NULL, NULL, >>>> + NULL); >>>> + >>>> + rc = grn_obj_reindex(context, table); >>>> + rb_grn_context_check(context, self); >>>> + rb_grn_rc_check(rc, self); >>>> + >>>> + return Qnil; >>>> +} >>>> + >>>> void >>>> rb_grn_init_table (VALUE mGrn) >>>> { >>>> @@ -2765,6 +2819,8 @@rb_grn_init_table (VALUE mGrn) >>>> >>>> rb_define_method(rb_cGrnTable, "rename", rb_grn_table_rename, >>>> 1); >>>> >>>> + rb_define_method(rb_cGrnTable, "reindex", rb_grn_table_reindex, >>>> 0); >>>> + >>>> rb_grn_init_table_key_support(mGrn); >>>> rb_grn_init_array(mGrn); >>>> rb_grn_init_hash(mGrn); >>>> >>>> Modified: test/test-table.rb (+40 -0) >>>> =================================================================== >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859a> >>>> >>>> 1 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL1> >>>> >>>> >>>> 2 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL2> >>>> >>>> 3 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL3> >>>> >>>> 4 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL4> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL420> >>>> >>>> 421 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL421> >>>> >>>> 422 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL422> >>>> >>>> 423 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL423> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> 424 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL424> >>>> >>>> 425 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL425> >>>> >>>> 426 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aL426> >>>> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859a> >>>> >>>> 1 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR1> >>>> >>>> 2 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR2> >>>> >>>> 3 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR3> >>>> >>>> 4 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR4> >>>> >>>> 5 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR5> >>>> >>>> ... >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR421> >>>> >>>> 422 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR422> >>>> >>>> 423 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR423> >>>> >>>> 424 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR424> >>>> >>>> 425 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR425> >>>> >>>> 426 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR426> >>>> >>>> 427 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR427> >>>> >>>> 428 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR428> >>>> >>>> 429 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR429> >>>> >>>> 430 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR430> >>>> >>>> 431 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR431> >>>> >>>> 432 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR432> >>>> >>>> 433 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR433> >>>> >>>> 434 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR434> >>>> >>>> 435 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR435> >>>> >>>> 436 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR436> >>>> >>>> 437 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR437> >>>> >>>> 438 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR438> >>>> >>>> 439 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR439> >>>> >>>> 440 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR440> >>>> >>>> 441 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR441> >>>> >>>> 442 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR442> >>>> >>>> 443 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR443> >>>> >>>> 444 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR444> >>>> >>>> 445 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR445> >>>> >>>> 446 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR446> >>>> >>>> 447 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR447> >>>> >>>> 448 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR448> >>>> >>>> 449 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR449> >>>> >>>> 450 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR450> >>>> >>>> 451 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR451> >>>> >>>> 452 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR452> >>>> >>>> 453 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR453> >>>> >>>> 454 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR454> >>>> >>>> 455 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR455> >>>> >>>> 456 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR456> >>>> >>>> 457 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR457> >>>> >>>> 458 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR458> >>>> >>>> 459 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR459> >>>> >>>> 460 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR460> >>>> >>>> 461 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR461> >>>> >>>> 462 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR462> >>>> >>>> 463 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR463> >>>> >>>> 464 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR464> >>>> >>>> 465 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR465> >>>> >>>> 466 >>>> <https://github.com/ranguba/rroonga/commit/f67013037a2ce655057c4e5880a529b67f9b881c#diff-8101357455d6852a2f3db91d2076859aR466> >>>> >>>> >>>> @@ -1,4 +1,5 @@ >>>> # Copyright (C) 2009-2013 Kouhei Sutou <kou �� clear-code.com >>>> <mailto:kou �� clear-code.com>> >>>> +# Copyright (C) 2016 Masafumi Yokoyama <yokoyama �� clear-code.com >>>> <mailto:yokoyama �� clear-code.com>> >>>> # >>>> # This library is free software; you can redistribute it and/or >>>> # modify it under the terms of the GNU Lesser General Public >>>> @@ -421,6 +422,45 @@class TableTest < Test::Unit::TestCase >>>> sorted_bookmarks.collect(&:value)) >>>> end >>>> >>>> + def test_reindex >>>> + Groonga::Schema.define do |schema| >>>> + schema.create_table("Memos", >>>> + :type => :array) do |table| >>>> + table.text("content") >>>> + end >>>> + schema.create_table("Terms", >>>> + :type => :patricia_trie, >>>> + :key_type => :short_text, >>>> + :default_tokenizer => "TokenBigram", >>>> + :normalizer => "NormalizerAuto") do |table| >>>> + table.index("Memos.content") >>>> + end >>>> + end >>>> + >>>> + memos = context["Memos"] >>>> + memos.add(:content => "This is a memo") >>>> + >>>> + terms = context["Terms"] >>>> + terms.delete("this") >>>> + >>>> + assert_equal([ >>>> + "a", >>>> + "is", >>>> + "memo", >>>> + ], >>>> + terms.collect(&:_key).sort) >>>> + >>>> + terms.reindex >>>> + >>>> + assert_equal([ >>>> + "a", >>>> + "is", >>>> + "memo", >>>> + "this", >>>> + ], >>>> + terms.collect(&:_key).sort) >>>> + end >>>> + >>>> sub_test_case "#geo_sort" do >>>> setup >>>> def setup_schema >>>> >>>> _______________________________________________ >>>> Groonga-commit mailing list >>>> Groonga-commit �� lists.osdn.me <mailto:Groonga-commit �� lists.osdn.me> >>>> http://lists.osdn.me/mailman/listinfo/groonga-commit >>> >>> >>> >>> _______________________________________________ >>> Groonga-commit mailing list >>> Groonga-commit �� lists.osdn.me >>> http://lists.osdn.me/mailman/listinfo/groonga-commit >>> >> >> > > -- 横山 昌史 <Masafumi Yokoyama> E-mail: yokoyama �� clear-code.com 株式会社クリアコード 〒170-0005 東京都豊島区南大塚3-29-9 Tel: 03-5927-9440 Web: http://www.clear-code.com/