安装依赖
yum install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel
下载coreseek 4.1
$ wget http://www.coreseek.cn/uploads/csft/4.0/coreseek-4.1-beta.tar.gz
$ tar xzvf coreseek-4.1-beta.tar.gz $ cd coreseek-4.1-beta
解压并安装mmseg
tar zxvf coreseek-4.1-beta.tar.gz cd coreseek-4.1-beta cd mmseg-3.2.14 ./bootstrap ./configure --prefix=/opt/local/mmseg3 make && make install cd ..
安装csft
$ cd csft-4.1 $ sh buildconf.sh $ ./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 make
报错:
collect2: ld returned 1 exit status
make[2]:*** [indexer] Error 1
make[2]:Leaving directory `/opt/software/csft-4.1/src’
make[1]:*** [all] Error 2
make[1]:Leaving directory `/ opt/software/csft-4.1/src’
make:*** [all-recursive] Error 1
处理
make cleanvi src/MakefileLIBS = -lm -lexpat -L/usr/local/lib修改为LIBS = -lm -lexpat -liconv -L/usr/local/libmake && make installcd ..
测试服务和搜索
cd testpack/ #数据源 cat var/test/test.xml #此时应该正确显示中文 #在/usr/local/mmseg3/etc目录下uni.lib就是分成文件,通过unigram.txt文本经过/usr/local/mmseg3/bin/mmseg -u 命令生成,将展示test.xml文档按分词文件切分后的结果 /usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc var/test/test.xml #根据配置文件生成索引文件 /usr/local/coreseek/bin/indexer -c etc/csft.conf --all
csft.con #源定义 source xml {type = xmlpipe2xmlpipe_command = cat var/test/test.xml#请修改为实际使用的绝对路径,例如:cat /usr/local/coreseek/var/...
#这里定义源地址 }#index定义 index xml {source = xml #对应的source名称path = var/data/xml
#请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
#生成索引的存放地址,该目录下生成xml.spa xml.spb等文件,命名规则貌似是source名称加后缀docinfo = externmlock = 0morphology = nonemin_word_len = 1html_strip = 0#中文分词配置,详情请查看:http://www.coreseek.cn/products-install/coreseek_mmseg/charset_dictpath = /usr/local/mmseg3/etc/
#BSD、Linux环境下设置,/符号结尾
#分词文件路径,即uni.lib#charset_dictpath = etc/ #Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/...charset_type = zh_cn.utf-8 }#全局index定义 indexer {mem_limit = 128M }#searchd服务定义 searchd {listen = 9312read_timeout = 5max_children = 30max_matches = 1000seamless_rotate = 0preopen_indexes = 0unlink_old = 1pid_file = var/log/searchd_xml.pid #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...log = var/log/searchd_xml.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...query_log = var/log/query_xml.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...binlog_path = #关闭binlog日志 }
报错error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
解决办法如下:
1.在/etc/ld.so.conf中加一行/usr/local/lib, 2.然后运行/sbin/ldconfig /usr/local/coreseek/bin/indexer -c etc/csft.conf --all
/usr/local/coreseek/bin/search -c etc/csft.conf 网络搜索#using config file 'etc/csft.conf'...#index 'xml': query '网络搜索 ': returned 1 matches of 1 total in 0.000 sec#displaying matches:#1. document=1, weight=1590, published=Thu Apr 1 22:20:07 2010, author_id=1#words:#1. '网络': 1 documents, 1 hits#2. '搜索': 2 documents, 5 hits
到此coreseek安装完成,基本根据官方文旦安装即可http://www.coreseek.cn/products-install/install_on_bsd_linux/