tatamilab.jp
某DBにて、いろいろ試行錯誤しながら、日本語による全文検索を実装することができた。 はたして本当に効果があったのだろうか・・・と調べてみる。 全レコード数:32740 フィールド(フィールドタイプ:TEXT)には、日本語による文章を入れてあり、 全体のうち、4つのレコードのに世界最大のカルデラを持った阿蘇5岳の一つ、山頂のギザギザが特徴的な根子岳です。(省略)という文章が入っている。で、全レコードから「ギザギザ」という文字で検索するとする。この4レコードを探すとする。 LIKEでやる場合、 SELECT * FROM `main` WHERE COMMENT LIKE "%ギザギザ%" レコード表示 0 - 3 (4 合計, Query took 3.1908 sec) と、3秒ちょっとかかった。(実はサーバ自体の性能もあまりよくないんだけれど) EXPLAINすると、ro
自分メモ。 MySQL自体には、Full Textという全文検索機能があることはあるが、日本語には対応してない。 いまんところ、LIKE %hoge%でやったりしてるんだけれど、当然、インデックスが使われないので遅い。 なんとかMySQLにおいて、(簡単に)日本語で全文検索する方法がないか調べてみた。 MySQLについて 伍より MySQLで日本語全文検索を行うためには、まず、形態素解析やN-gramによって、文字列をワードごとに分割して、スペースで区切り、さらに、16進数文字に変換したりして、あたかも日本語ではないかのように装う必要があります。 MySQLでお気楽全文検索 では、chasenを使って、日本語を単語に分割し、DBに登録しているのだけれど、Perlなので読むきがしない・・ 方法として、2つあるようです。 1)chasenなどを使って、日本語を単語に分割して、コード化
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く