内射女校花一区二区三区,久久久老熟女一区二区三区,国产精品美女久久久网站,亚洲成AV人片在

Board logo

標題: [求助] 能否給一個基于WDCP的安裝Sphinx的教程? [打印本頁]

作者: longyushen    時間: 2015-1-18 01:32     標題: 能否給一個基于WDCP的安裝Sphinx的教程?

官方能否發(fā)布一個安裝Sphinx的教程?在DZ要用到全文搜索,需要安裝Sphinx,
在網(wǎng)上找的方法都用不了,希望官方能出一個在WDCP里面安裝的教程。按照以下方法操作都不行
作者: longyushen    時間: 2015-1-18 01:33

本帖最后由 longyushen 于 2015-1-18 01:36 編輯

例如:
1. 安裝軟件
wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.13.tar.gz
tar zxvf coreseek-3.2.13.tar.gz
cd coreseek-3.2.13
cd mmseg-3.2.13
./bootstrap #這一步也許會出錯,提示很多command not found , 解決辦法: 安裝 libtool centos 直接使用yum安裝 : yum install -y libtool
./configure --prefix=/usr/local/mmseg
make && make install
cd csft-3.2.13
./configure --prefix=/usr/local/sphinx  --with-mysql=/www/wdlinux/mysql-5.1.63  --with-mmseg=/usr/local/mmseg/ --with-mmseg-includes=/usr/local/mmseg/include/mmseg/  --with-mmseg-libs=/usr/local/mmseg/lib/
make && make install
作者: longyushen    時間: 2015-1-18 01:35

2. 配置sphinx
vim /usr/local/sphinx/etc/csft.cnf # 內容如下

csft.cnf代碼.zip (2.51 KB)
3. 首次生成索引
/usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf --all

4. 啟動sphinx
/usr/local/sphinx/bin/searchd --config /usr/local/sphinx/etc/csft.conf

5. 指定計劃任務
* 0-3 * * * root /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf posts_minute --rotate
* 6-23 * * * root /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf posts_minute --rotate
0 4 * * * root /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf posts_merge --rotate && /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf --merge posts posts_merge --rotate

* 0-3 * * * root /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf threads_minute --rotate
* 6-23 * * * root /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf threads_minute --rotate
0 4 * * * root /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf threads_merge --rotate && /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/csft.conf --merge threads threads_merge --rotate
復制代碼

6. 設置discuz后臺
使用創(chuàng)始人賬號登陸discuz后臺, 全局 -> 搜索設置 ->
開啟sphinx
sphinx 主機名 localhost
端口: 3312
標題索引名: threads,threads_minute
全文索引名:posts,posts_minute
項目數(shù):10000
模式:保持默認即可

7. 更改discuz代碼
打開/source/module/search/forum.php
找到以下這行
if($srchtype == 'fulltext' && $_G['setting']['sphinxon']) {
改成
if($_G['setting']['sphinxon']) {
再找到下面幾行(注意:僅在你discuz版本為gbk時才需要做 以下修改)
f($srchtype == "fulltext") {
$result = $s->query("'".$srchtxt."'", $_G['setting']['sphinxmsgindex']);
} else {
$result = $s->query($srchtxt, $_G['setting']['sphinxsubindex']);
}
改成
$_srchtxt = iconv('gbk','utf-8',$srchtxt); //將gbk轉成 utf-8
if($srchtype == "fulltext") {
$result = $s->query("'".$_srchtxt."'", $_G['setting']['sphinxmsgindex']);
} else {
$result = $s->query($_srchtxt, $_G['setting']['sphinxsubindex']);
}

附件: csft.cnf代碼.zip (2015-1-18 01:35, 2.51 KB) / 下載次數(shù) 15
http://www.sdymsy.com/bbs/attachment.php?aid=4994&k=754bb9b1d4d9caa9409897531d752ef9&t=1746309106&sid=OZzGk7
作者: longyushen    時間: 2015-1-20 14:05

頂上去,怎么沒有人處理的呢?
作者: longyushen    時間: 2015-1-29 14:04

,.........
作者: longyushen    時間: 2015-1-30 10:54

。。。。。。
作者: longyushen    時間: 2015-1-31 02:04

。。。。。。。。。。。。。。。。。。。。。。。
作者: whale1011    時間: 2015-5-6 23:02

asdfasdfasdfasdfasdfasdf
作者: shanyingqing    時間: 2016-5-19 12:28

分詞這塊還是不錯的




歡迎光臨 WDlinux官方論壇 (http://www.sdymsy.com/bbs/) Powered by Discuz! 7.2