sphinx mysql5.7_DedeCMS V5.7全文检索sphinx安装使用教程

#源定义

source mysql

{

type = mysql

# 数据库服务器基本配置信息

sql_host = 192.168.0.103

sql_user = dedev57

sql_pass = dedecms

sql_db = dedecmsv57gbk

sql_port = 3306

# 设定编码,这里我们是gbk编码,如果是utf-8,可以设置:

# sql_query_pre = SET NAMES utf8

sql_query_pre = SET NAMES gbk

# 数据检索增量

sql_range_step = 1000

#当前***新文档id数

sql_query_pre = REPLACE INTO dede_sphinx SELECT 1, MAX(id) FROM dede_archives

#检索条件

sql_query = SELECT ARC.id,ARC.typeid,ARC.typeid2,ARC.sortrank,ARC.flag,ARC.channel,ARC.ismake,ARC.arcrank,ARC.click,ARC.title,

ARC.shorttitle,ARC.color,ARC.writer,ARC.source,ARC.litpic,ARC.pubdate,ARC.senddate,ARC.mtype,ARC.description,ARC.badpost,ARC.goodpost,ARC.scores,

ARC.lastpost,ARC.keywords,ARC.mid,ART.body FROM dede_archives AS ARC LEFT JOIN dede_addonarticle AS ART ON ARC.id = ART.aid WHERE ARC.id>=$start

AND ARC.id<=$end #sql_query***列id需为整数

#title、body作为字符串/文本字段,被全文索引

# 获取当前***大检索id

sql_query_range = SELECT 1,maxaid FROM dede_sphinx WHERE countid=1

sql_attr_uint = typeid #从SQL读取到的值必须为整数

sql_attr_uint = typeid2

sql_attr_uint = channel

sql_attr_uint = click

sql_attr_uint = badpost

sql_attr_uint = goodpost

sql_attr_uint = scores

sql_attr_uint = mid

sql_attr_timestamp = pubdate #从SQL读取到的值必须为整数,作为时间属性

sql_attr_timestamp = senddate

sql_attr_timestamp = lastpost

#命令行查询时,从数据库读取原始数据信息

sql_query_info = SELECT ARC.*,ART.body FROM dede_archives AS ARC LEFT JOIN dede_addonarticle AS ART ON ARC.id = ART.aid WHERE

ARC.id=$id

}

source delta

{

type = mysql

# 数据库服务器基本配置信息

sql_host = 192.168.0.103

sql_user = dedev57

sql_pass = dedecms

sql_db = dedecmsv57gbk

sql_port = 3306

sql_query_pre = SET NAMES gbk

# 增量索引,从***大id开始

sql_query = SELECT ARC.id,ARC.typeid,ARC.typeid2,ARC.sortrank,ARC.flag,ARC.channel,ARC.ismake,ARC.arcrank,ARC.click,ARC.title,

ARC.shorttitle,ARC.color,ARC.writer,ARC.source,ARC.litpic,ARC.pubdate,ARC.senddate,ARC.mtype,ARC.description,ARC.badpost,ARC.goodpost,

ARC.scores,ARC.lastpost,ARC.keywords,ARC.mid,ART.body FROM dede_archives AS ARC LEFT JOIN dede_addonarticle AS ART ON ARC.id

= ART.aid WHERE ARC.id > ( SELECT maxaid FROM dede_sphinx WHERE countid=1 )

#从SQL读取到的值必须为整数

sql_query_post = REPLACE INTO dede_sphinx SELECT 1, MAX(id) FROM dede_archives

sql_attr_uint = typeid

sql_attr_uint = typeid2

sql_attr_uint = channel

sql_attr_uint = click

sql_attr_uint = badpost

sql_attr_uint = goodpost

sql_attr_uint = scores

sql_attr_uint = mid

sql_attr_timestamp = pubdate #从SQL读取到的值必须为整数,作为时间属性

sql_attr_timestamp = senddate

sql_attr_timestamp = lastpost

#命令行查询时,从数据库读取原始数据信息

sql_query_info = SELECT ARC.*,ART.body FROM dede_archives AS ARC LEFT JOIN dede_addonarticle AS ART ON ARC.id

= ART.aid WHERE ARC.id=$id

}

#index定义

index mysql

{

source = mysql #对应的source名称

path = D:/coreseek-3.2.13-win32/var/data/mysql

docinfo = extern

mlock = 0

morphology = none

min_word_len = 1

html_strip = 0

#charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾

charset_dictpath = D:/coreseek-3.2.13-win32/etc/ #Windows环境下设置,/符号结尾

charset_type = zh_cn.gbk

}

index delta : mysql

{

min_word_len = 1

source = delta

path = D:/coreseek-3.2.13-win32/var/data/delta.new

}

#全局index定义

indexer

{

mem_limit = 128M

}

#searchd服务定义

searchd

{

listen = 9312

read_timeout = 5

max_children = 30

max_matches = 1000

seamless_rotate = 0

preopen_indexes = 0

unlink_old = 1

pid_file = D:/coreseek-3.2.13-win32/var/log/searchd_mysql.pid

log = D:/coreseek-3.2.13-win32/var/log/searchd_mysql.log

query_log = D:/coreseek-3.2.13-win32/var/log/query_mysql.log

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值