无标题文档
wdCP系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdCDN系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
wdOS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdDNS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
注册 发贴 提问 回复-必看必看 wddns免费智能 DNS 开通 本地或虚拟机使 用wdcp 一键包在mysql编 译时"卡住"
【300G高防】双线 无视攻击 wdcp官方技术支持/服务 阿里云8折优惠券 无敌云 腾讯云优惠中,现注册更有260代金额券赠送
返回列表 发帖
提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等

温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的

[求助] 能否给一个基于WDCP的安装Sphinx的教程?

官方能否发布一个安装Sphinx的教程?在DZ要用到全文搜索,需要安装Sphinx,
在网上找的方法都用不了,希望官方能出一个在WDCP里面安装的教程。按照以下方法操作都不行

本帖最后由 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

TOP

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后台
使用创始人账号登陆discuz后台, 全局 -> 搜索设置 ->
开启sphinx
sphinx 主机名 localhost
端口: 3312
标题索引名: threads,threads_minute
全文索引名:posts,posts_minute
项目数: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']);
}

TOP

顶上去,怎么没有人处理的呢?

TOP

,.........

TOP

。。。。。。

TOP

。。。。。。。。。。。。。。。。。。。。。。。

TOP

asdfasdfasdfasdfasdfasdf
afasd

TOP

分词这块还是不错的
52jobw.cn

TOP

返回列表