build
libtool, libssl-dev, pkg-config, autoconf, automake とか入れとこう。要らないかも知んないけど。
- mysql-5.1.53-log
- /usr/local/mysql にバイナリを展開
- master が 5.1 で、 slave のみ fulltext index という都合で 5.1
- ソースは http://files.directadmin.com/services/all/mysql/ から拾った。なんかすごい勢いて転がっててビビる
- groonga
% git clone git://github.com/groonga/groonga.git % ./configure --prefix=/usr/local/groonga --with-default-encoding=euc_jp % make -j4 % sudo make install
- mroonga
% git clone git://github.com/mroonga/mroonga.git % export PKG_CONFIG_PATH=/usr/local/groonga/lib/pkgconfig % export CFLAGS="-I/usr/local/groonga/include" % export CXXFLAGS="-I/usr/local/groonga/include" % export LDFLAGS="-L/usr/local/groonga/lib -R/usr/local/groonga/lib" % ./configure --with-mysql-source=/home/ichii386/opt/src/mysql/mysql-5.1.53 --with-mysql-config=/usr/local/mysql/bin/mysql_config % make % sudo make install
バイナリつくり直すときは drop database からやり直すと確実。
too long key
記号の超長い羅列みたいなゴミレコードで "too long key" のエラーが出る。 tokenizer が、記号列を 1 token とする "TokenBigram" になっていて、無視してもいいんだけど slave である都合 (master でエラーにならない都合) 、止めてはマズい。
こういうゴミ patch で頑張りすぎないのがオトナなんですかね?
--- a/ha_mroonga.cc +++ b/ha_mroonga.cc @@ -1133,7 +1133,9 @@ int ha_mroonga::create(const char *name, TABLE *table, HA_CREATE_INFO *info) if (key_alg == HA_KEY_ALG_FULLTEXT) { grn_info_type info_type = GRN_INFO_DEFAULT_TOKENIZER; - grn_obj *token_type = grn_ctx_at(ctx, GRN_DB_BIGRAM); + //grn_obj *token_type = grn_ctx_at(ctx, GRN_DB_BIGRAM); + const char *t = "TokenBigramSplitSymbolAlphaDigit"; + grn_obj *token_type = grn_ctx_get(ctx, t, strlen(t)); grn_obj_set_info(ctx, idx_tbl_obj, info_type, token_type); }
謝辞
groonga 開発者のみなさまありがとうございます!もうちょい頑張って使ってみます。