mysql中文全文搜尋

2021-06-06 02:02:05 字數 692 閱讀 4239

centos6

xampp1.7.7

mysql5.5

# /opt/lampp/bin/mysql -uroot -ppassword

mysql> show variables like 'plugin_dir';

外掛程式路徑:/opt/lampp/lib/mysql/plugin

# wget

# tar zxvf mysqlcft-1.0.0-x86_64-bin.tar.gz

# cp mysqlcft.so /opt/lampp/lib/mysql/plugin

# /opt/lampp/bin/mysql -uroot -ppassword

mysql> install plugin mysqlcft soname 'mysqlcft.so';

mysql> select * from mysql.plugin;

mysql> show plugins;

alter ignore table articles add fulltext index cnfullindex (title,body) with parser mysqlcft;

select * from articles where match(title,body) against ('北京' in boolean mode);

lanti1和utf8的表已經測試

MySQL全文檢索中文搜尋

全文檢索概述 檢索基本過程 全文檢索大體分兩個過程,索引建立 indexing 和搜尋索引 search 索引建立 將需要被搜尋的資料提取資訊,建立索引的過程。搜尋索引 就是得到使用者的查詢請求,搜尋建立的索引,然後返回結果的過程。全文檢索的索引建立過程一般有以下幾步 1 準備待索引的原資料 2 將...

mysql全文索引中文搜尋

由於mysql的預設配置是索引的詞的長度是4,所以需要修改mysql的配置檔案my.cnf 在 mysqld 位置內加入 ft min word len 2 其它屬性還有 ft wordlist charset gbk ft wordlist file home mysql wordlist gbk...

Mysql全文搜尋match against的用法

全文檢索在 mysql 中就是乙個 fulltext 型別索引。fulltext 索引用於 myisam 表,可以在 create table 時或之後使用 alter table 或 create index 在 char varchar 或 text 列上建立對於大的資料庫,將資料裝載到乙個沒有...