Sphinx中文分词在discuz 中的应用(3)
type = mysql
sql_query_pre =
sql_query_pre = SET NAMES UTF8
sql_query_pre = SET SESSION query_cache_type=OFF
sql_query_pre = REPLACE INTO pre_common_sphinxcounter SELECT 2, MAX(pid) FROM pre_forum_post
sql_query = SELECT p.pid AS id,p.tid,p.subject,p.message,t.digest,t.displayorder,t.authorid,t.lastpost,t.special \
FROM pre_forum_post AS p LEFT JOIN pre_forum_thread AS t USING(tid) where p.pid >=$start and p.pid <=$end \
AND p.first=1
sql_query_range = SELECT (SELECT MIN(pid) FROM pre_forum_post),maxid FROM pre_common_sphinxcounter WHERE indexid=2
sql_range_step = 5000
sql_attr_uint = tid
sql_attr_uint = digest
sql_attr_uint = displayorder
sql_attr_uint = authorid
sql_attr_uint = special
sql_attr_timestamp = lastpost
sql_query_info = SELECT * FROM pre_forum_post WHERE pid=$id
}
#posts
index pre_forum_post
{
source = pre_forum_post
path = /data1/dzbbs/indexdata/pre_forum_post #windows下最好用全路径
docinfo = extern
mlock = 0
morphology = none
#charset_dictpath = /usr/local/mmseg32/etc/ #BSD、Linux环境下设置,/符号结尾
#charset_dictpath= etc/ #Windows环境下设置,/符号结尾
#charset_debug = 0
#### 索引的词最小长度
min_word_len = 2
#charset_type = zh_cn.utf-8
html_strip = 0
##### 字符表,注意:如使用这种方式,则sphinx会对中文进行单字切分,
##### 即进行字索引,若要使用中文分词,必须使用其他分词插件如 coreseek,sfc
charset_type = utf-8
chinese_dictionary = /usr/local/sfc22/etc/xdict
min_prefix_len = 0
min_infix_len = 1
ngram_len = 0
- 发表评论
-
- 最新评论 更多>>