歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu Coreseek安裝配置

Ubuntu Coreseek安裝配置

日期:2017/2/28 16:27:22   编辑:Linux教程

一切按照官方的說明文檔來安裝,但到最好配置時卻老配置老出錯。最終只能再google一下,按下面的配置才算搞定。剛玩coreseek,對一些參數還不是很熟悉,但又想配置起來玩下,沒有好好地看官方說明文檔呵呵。

防止出現編譯錯誤,先安裝以下程序
yum -y install mysql mysql-devel php-mysql qt4-mysql python python-dev gcc-c++ gtk+ libtool automake autoconf glibc-common expat-devel

1、安裝
wget http://www.coreseek.cn/uploads/csft/3.1/Source/csft-3.1.tar.gz ####coreseek源文件
wget http://www.coreseek.cn/uploads/csft/3.1/Source/mmseg-3.1.tar.gz #####coreseek所使用的詞典
tar zxvf csft-3.1.tar.gz
tar zxvf mmseg-3.1.tar.gz

#####在安裝coreseek前必須先安裝mmseg
cd mmseg-3.1
./configure –prefix=/usr/local/mmseg
make
make install

######## 安裝coreseek ########
##這裡不使用python數據源,若需要,請加上 –with-python,在mmseg上一定要對應路徑
./configure –prefix=/usr/local/coreseek –with-mmseg-includes=/usr/local/mmseg/include/mmseg –with-mmseg-libs=/usr/local/mmseg/lib –without-iconv

指定–enable-id64選項會打開64位文檔ID和詞ID的支

make
make install

若無問題,安裝完畢後在/usr/local/下生成 coreseek目錄及其下文件。

接下來要生成 mmseg詞庫及配置文件:
cd /usr/loca/mmseg
/usr/local/mmseg/bin/mmseg -u /usr/local/src/mmseg-3.1/data/unigram.txt ###unigram.txt是對應的詞典文件,將會生成unigram.txt.uni
cd ../coreseek
mkdir dict ###創建字典目錄
cp /usr/local/src/mmseg-3.1/data/unigram.txt.uni dict/uni.lib ###把創建的詞典復制到dict
vim dict/mmseg.ini ####創建mmseg的配置文件,此文件在coreseek的windows版本已自帶!

mmseg.ini:
[mmseg]
merge_number_and_ascii=1;
number_and_ascii_joint=-;
compress_space=0;
seperate_number_ascii=1;
至此,mmseg配置完畢!下一步配置csft.conf——coreseek的配置文件

source article
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass = jiaxian
sql_db = test
sql_port = 3306 # optional, default is 3306

sql_query_pre = SET NAMES utf8
#sql_query_pre = SET SESSION query_cache_type=OFF ##這個可以關閉sql查詢緩存
#sql_query = SELECT id, classid, checked, title, newstime, newstext FROM article
sql_query_range = SELECT MIN(id),MAX(id) FROM article
sql_range_step = 1000
sql_query = SELECT id, classid, checked, title, newstime, newstext FROM article WHERE id>=$start AND id<=$end

sql_attr_uint = classid
sql_attr_uint = checked
sql_attr_uint = newstime
sql_query_info = select * from article where id=$id

}

index article
{
source = article
path = /usr/local/coreseek/var/data/article
docinfo = extern
charset_type = zh_cn.utf-8 ###指定coreseek的編碼
charset_dictpath = /usr/local/coreseek/dict #####coreseek字典文件

min_prefix_len = 0
min_infix_len = 0
min_word_len = 2
ngram_len = 1
ngram_chars = U+4E00..U+9FBF, U+3400..U+4DBF, U+20000..U+2A6DF, U+F900..U+FAFF,\
U+2F800..U+2FA1F, U+2E80..U+2EFF, U+2F00..U+2FDF, U+3100..U+312F, U+31A0..U+31BF,\
U+3040..U+309F, U+30A0..U+30FF, U+31F0..U+31FF, U+AC00..U+D7AF, U+1100..U+11FF,\
U+3130..U+318F, U+A000..U+A48F, U+A490..U+A4CF
html_strip = 0
}

indexer
{
mem_limit = 256M
}
searchd
{
# address = 0.0.0.0
log = /usr/local/coreseek/var/log/searchd.log
query_log = /usr/local/coreseek/var/log/query.log
read_timeout = 5
max_children = 30
pid_file = /usr/local/coreseek/var/log/searchd.pid
max_matches = 1000
seamless_rotate = 1
}

Copyright © Linux教程網 All Rights Reserved