用户常常抱怨dz的搜索搜不出想要的东西。
环境 CentOS5.3 X86_64
经过大半天的测试,终于装上了coreseek3.1,中间碰到不少问题
mmseg安装是比较容易。
./configure –prefix=/usr/servers/mmseg
make
make install
coreseek安装的时候会出现一些问题,我没有选择python支持。
./configure –prefix=/usr/servers/coreseek –with-mysql=/usr/servers/mysql –with-mysql-includes=/usr/servers/mysql/include/mysql –with-mysql-lib=/usr/servers/mysql/lib/mysql –with-mmseg-includes=/usr/servers/mmseg/include/mmseg –with-mmseg-libs=/usr/servers/mmseg/lib/ –enable-id64 –with-liconv
undefined reference to `libiconv_open’
undefined reference to `libiconv_close’
网上的解决方法是
官网解决办法:
In the meantime I’ve change the configuration file and set
#define USE_LIBICONV 0 in line 8179.
修改configure 文件把 #define USE_LIBICONV 0 最后的数值由1改为0
重新编译。
vi ./src/sphinx.cpp
注释以下代码
#case TOKENIZER_ZHCN_GBK:
#pTokenizer = sphCreateGBKChineseTokenizer
#(tSettings.m_sDictPath.cstr(), tSettings.m_nBest); break;
然后重新编译
make clean
但是这样的方法,把GBK的支持去掉了,只能用UTF8。比较完美的解决方法是
vi /src/Makefile
将
LIBS = -lm -lz -lexpat -L/usr/local/lib -lpthread
改为
LIBS = -lm -lz -lexpat - liconv -L/usr/local/lib -lpthread
再把根目录下Makefile也这样改一下。
要在configure之后改,然后make。
测试建立索引,出现错误
FATAL: no readable config file (looked in /usr/servers/coreseek/etc/sphinx.conf, ./sphinx.conf)
解决方法,–config后面的路径写绝对路径。
OK了。接下来看看怎么用API了。





