数据源配置:xml数据源
Windows操作系统下:xml数据源配置(对应coreseek-3.2.13-win32/etc/csft.conf)
#源定义
source xml
{
type = xmlpipe2
xmlpipe_command = bin\cat var/test/test.xml #此处也可使用其他可执行程序输出xml数据
}
#index定义
index xml
{
source = xml #对应的source名称
path = var/data/xml
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
html_strip = 0
#charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾
charset_dictpath = etc/ #Windows环境下设置,/符号结尾
charset_type = zh_cn.utf-8
}
BSD、Linux操作系统下:xml数据源配置(对应csft-3.2.13/testpack/etc/csft.conf)
#源定义
source xml
{
type = xmlpipe2
xmlpipe_command = cat var/test/test.xml #此处也可使用其他可执行程序输出xml数据
}
#index定义
index xml
{
source = xml #对应的source名称
path = var/data/xml
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
html_strip = 0
charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾
#charset_dictpath = etc/ #Windows环境下设置,/符号结尾
charset_type = zh_cn.utf-8
}
xml数据格式:【请参考手册获得详细信息】
<?xml version="1.0" encoding="utf-8"?> <sphinx:docset> <sphinx:schema> <sphinx:field name="subject"/> <sphinx:field name="content"/> <sphinx:attr name="published" type="timestamp"/> <sphinx:attr name="author_id" type="int" bits="16" default="1"/> </sphinx:schema> <sphinx:document id="1"> <subject>愚人节最佳蛊惑爆料 谷歌300亿美元收购百度</subject> <published>1270131607</published> <content>据国外媒体报道,谷歌将巨资收购百度,涉及金额高达300亿美元。谷歌借此重返大陆市场。...... </content> <author_id>1</author_id> </sphinx:document> <sphinx:document id="2"> <subject>Twitter主页改版 推普通用户消息增加趋势话题</subject> <published>1270135548</published> <content>4月1日消息,据国外媒体报道,Twitter本周二推出新版主页,目的很简单:帮助新用户了解Twitter和增加用户黏稠度。...... </content> <author_id>1</author_id> </sphinx:document> <sphinx:document id="3"> <subject>死都要上!Opera Mini 体验版抢先试用</subject> <published>1270094460</published> <content>Opera一直都被认为是浏览速度飞快,同时在移动平台上更是占有不少的份额。...... </content> <author_id>2</author_id> </sphinx:document> </sphinx:docset>
上一篇: 一元切分模式核心配置
下一篇: 数据源配置:mysql数据源