安裝依賴
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/
?
?
?
?
?
?
?