DedeCMS v5.7全文检索使用说明(sphinx)
2012-03-30 11:55:14 来源:WEB开发网核心提示: # 数据库服务器基本配置信息 sql_host = 192.168.0.103 sql_user = dedev57 sql_pass = dedecms sql_db = dedecmsv57gbk sql_port = 3306 # 设定编码,这里我们是gbk编码,如果是utf-8,可
# 数据库服务器基本配置信息
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_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
更多精彩
赞助商链接