linux如何安装Senna
下载rmp文件:
http://sourceforge.jp/projects/tritonn/releases/
下载所有的x86相关文件
通过以下命令安装
# rpm -ivh mecab-0.97-tritonn.1.0.12.i386.rpm
# rpm -ivh mecab-ipadic-2.7.0.20070801-tritonn.1.0.12.i386.rpm
# rpm -ivh
senna-1.1.4-tritonn.1.0.12.i386.rpm
# rpm -ivh MySQL-*
安装后测试Senna是否正常安装
# mysql -u root test
mysql> CREATE TABLE t1 (c1 TEXT, FULLTEXT INDEX ft USING NGRAM (c1)) ENGINE = MyISAM DEFAULT CHARSET utf8;
Query OK, 0 rows affected (0.02 sec)
mysql> SHOW SENNA STATUS\G
mysql> INSERT INTO t1 VALUES ("中文文字内容测试,看是否能够搜索出来");
Query OK, 1 row affected (0.03 sec)
mysql> INSERT INTO t1 VALUES ("中文");
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM t1 WHERE MATCH(c1) AGAINST("中文");
注意:Senna目前全文搜索只支持日文和英文,对中文支持暂时没有。