资源站群CMS-如何配置sphinx全文索引模型
举例说明:假如要用资源站群CMS架设了一个避孕套商城,采集了几千万的淘宝数据,需要先将数据进行全文索引,参考配置文件如下:
#==搜索数据: cms --- m88_qx_id,m88_qx_content ===============
source cms_qx_88
{
type = mysql
sql_host = 127.0.0.1
sql_user = root
sql_pass = 123456
sql_db = cms
sql_port = 3306
sql_query_pre = SET NAMES utf8
sql_query = select qx_content.contentid,qx_content.mid,qx_content.check,qx_content.title,qx_content.title2,qx_content.catids,qx_id.contentid,qx_id.id1,qx_id.id2,qx_id.id3,qx_id.id4,qx_id.id5,qx_id.id6,qx_id.id7,qx_id.id8,qx_id.id9,qx_id.id10,qx_id.id11,qx_id.id12,qx_id.id13,qx_id.id14,qx_id.id15,qx_id.id16,qx_id.id17,qx_id.id18,qx_id.id19,qx_id.id20,qx_id.id21,qx_id.id22,qx_id.id23,qx_id.id24,qx_id.id25,qx_id.id26,qx_id.id27,qx_id.id28,qx_id.id29,qx_id.id30,qx_id.id31,qx_id.id32,qx_id.id33,qx_id.id34,qx_id.id35,qx_id.id36,qx_id.id37,qx_id.id38,qx_id.id39,qx_id.id40,qx_id.id41,qx_id.id42,qx_id.id43,qx_id.id44,qx_id.id45,qx_id.id46,qx_id.id47,qx_id.id48,qx_id.id49,qx_id.id50 from m88_qx_content as qx_content inner join m88_qx_id as qx_id on qx_content.contentid = qx_id.contentid
sql_attr_uint = mid
sql_attr_uint = check
sql_attr_float = zk_final_price
}
index cms_qx_88
{
source = cms_qx_88
path = /home1/coreseek_cms/var/data/cms_qx_88
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
html_strip = 0
charset_dictpath = /usr/local/mmseg3/etc/
charset_type = zh_cn.utf-8
}
#===================================================================
将88这个替换成您的id,然后执行索引命令。
/usr/local/coreseek/bin/indexer -c /home1/coreseek_cms/etc/lovelover.conf cms_qx_88 --rotate
indexer完毕后的数据就可供资源站群cms站点提供数据啦,通过配置不同的关键词进行聚合形成个性化的页面。