中文分词Sphinx + Coreseek Linux安装
中文分词Sphinx + Coreseek Linux安装
Alexsphinx 安装
1 | wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz |
- 安装coreseek 前
- 因为coreseek需要autoconf 2.64以上版本,因此需要升级autoconf,不然会报错。从http://download.chinaunix.net/download.php?id=29328&ResourceID=648下载autoconf-2.64.tar.bz2,安装方法如下:
1
2
3
4
5tar -jxvf autoconf-2.64.tar.bz2
cd autoconf-2.64
./configure
make
make install
- 因为coreseek需要autoconf 2.64以上版本,因此需要升级autoconf,不然会报错。从http://download.chinaunix.net/download.php?id=29328&ResourceID=648下载autoconf-2.64.tar.bz2,安装方法如下:
安装coreseek
1 | #安装mmseg(coreseek所使用的词典) |
安装coreseek(sphinx)
1 | cd csft-3.2.14 |
测试mmseg分词和coreseek搜索
1 | cd testpack |
- 可能会出现的问题:
安装mmseg的时候,./configure出现错误:config.status: error: cannot find input file: src/Makefile.in1
检查automake 版本
WARNING: source 'index1': xmlpipe2 support NOT compiled in. To use xmlpipe2, install missing XML libraries xmlpipe2 support NOT compiled
1
yum install expat-devel* #然后重装
- 相关依赖
1
2
3yum -y install m4 autoconf automake libtool
yum -y install gcc gcc-c++ wget
yum -y install mysql-devel - 编译不通过情况
1
2make时会出现一个错误
sphinxexpr.cpp:1013:43: 错误:‘ExprEval’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] - 解决
vi src/sphinxexpr.cpp
查找/ExprEval
按N切换到下一个1
2
3
4
5
6{
T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage
修改为
T val = this->ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage
共修改三个地方
} - 修改完重新执行 make && make install
- 报错:
error: cannot find input file: src/Makefile.in
1
2
3
4
5
6
7yum -y install libtool
aclocal
libtoolize --force
automake --add-missing
autoconf
autoheader
make clean - 报错:
ERROR: cannot find MySQL include files.
1
2
3
4
5### --with-mysql= 后边跟上mysql路径
./configure --prefix=/usr/local/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql=/usr/mysql/include/mysql
### 如果找不到
yum install mysql-devel ### 安装
mysql_config --include ## 查看路径 再次安装