Coreseek®  
 | 首页 | 注册 | 回复 | 搜索 | 统计资料 |                 网站首页产品服务开放源码安装使用联系我们 
全文检索 论坛首页 / 全文检索 /

关于csft.conf配置多个index的问题

 
dismissme
会员
#1 | 发表时间: 2010 02 27 17:37
回复 
csft.conf中有两个index 分别test1和test2 需要程序判断索引哪张表 程序正确的判断出了使用哪个表 但是使用这个索引 却索引不到数据(表中有个一模一样的数据) 开始使用一个索引的时候能索引到数据 不知道是什么原因

查询 中国的四大发明

Query stats:的结果是
'中国' found 1 times in 1 documents
'四 found 5 times in 5 documents
'大' found 12 times in 12 documents
'的' found 3285 times in 3044 documents
'发明' found 0 times in 0 documents

把我的配置文件发上来
source src1
{
type = mysql

# some straightforward parameters for SQL source types
sql_host = localhost
sql_user = root
sql_pass = bb
sql_db = faq
sql_port = 3306 # optional, default is 3306

sql_query_pre = SET NAMES utf8
sql_query_pre = SET SESSION query_cache_type=OFF

sql_query = SELECT id, url FROM s1

sql_ranged_throttle = 0

sql_query_info = SELECT * FROM s1 WHERE id=$id

}

source src2
{
type = mysql

sql_host = localhost
sql_user = root
sql_pass = bb
sql_db = faq
sql_port = 3306 # optional, default is 3306

sql_query_pre = SET NAMES utf8
sql_query_pre = SET SESSION query_cache_type=OFF

sql_query = SELECT id, site FROM s2

sql_ranged_throttle = 0

sql_query_info = SELECT * FROM s2 WHERE id=$id

}

source src1throttled : src1
{
sql_ranged_throttle = 100
}

index test1
{
source = src1

path = /usr/local/coreseek/var/data/

docinfo = extern

mlock = 0

morphology = none

min_word_len = 1

charset_type = zh_cn.utf-8
charset_dictpath = /usr/local/coreseek/var/dict

charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F

ngram_len = 1

ngram_chars = U+3000..U+2FA1F
}

index test2
{
source = src2

path = /usr/local/coreseek/var/data/

docinfo = extern

mlock = 0

morphology = none

min_word_len = 1

charset_type = zh_cn.utf-8
charset_dictpath = /usr/local/coreseek/var/dict
charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F

ngram_len = 1

ngram_chars = U+3000..U+2FA1F
}
dismissme
会员
#2 | 发表时间: 2010 02 27 17:38
回复 
我也重建了索引 如果把两张表和在一起只有一个索引的话却能索引到数据
wgbbiao
会员
#3 | 发表时间: 2010 02 27 19:07
回复 
查询的代码,能帖出来不?
dismissme
会员
#4 | 发表时间: 2010 02 28 02:53
回复 
def docoreseek(question, index):
mode = SPH_MATCH_EXTENDED
sort = SPH_SORT_RELEVANCE
host = 'localhost'
port = 3312

#self.index = '*'
cl = SphinxClient()
cl.SetServer(self.host, self.port)
cl.SetMatchMode(self.mode)
cl.SetSortMode(self.sort)
cl.SetLimits(0, 100)
res = self.cl.Query (question, self.index )
dismissme
会员
#5 | 发表时间: 2010 02 28 02:55
回复 
这是python的coreseek 接口
dismissme
会员
#6 | 发表时间: 2010 02 28 02:58
回复 
res = cl.Query (question, self.index )
dismissme
会员
#7 | 发表时间: 2010 03 01 09:19
回复 
index test1 index test2 有位置关系吗 我发现始终是使用tes1 使用前面的那一个
dismissme
会员
#8 | 发表时间: 2010 03 01 12:11
回复 
没有人回答吗
dismissme
会员
#9 | 发表时间: 2010 03 01 21:10
回复 
HonestQiao 呢 能出来回答一下吗
HonestQiao
会员
#10 | 发表时间: 2010 03 02 18:17
回复 
两者的id都是完全重复的吗?

如果不是的,请使用:

第一个:
sql_query = SELECT id*10+0,

第二个:
sql_query = SELECT id*10+1,

...这样子就可以区分了。
dismissme
会员
#11 | 发表时间: 2010 03 03 09:40
回复 
两个表的的ID都是自增的
我按照你说的实验了一下 还是不行啊 和之前一样的 还有我发现不管res = cl.Query (question, self.index )的self.index怎么改 都用的同一个索引test2(不是test1)
dismissme
会员
#12 | 发表时间: 2010 03 03 18:55
回复 
我发现我建立索引后的索引文件没有名字只有后缀 例如以前是test1stemmed.new.spa test1stemmed.new.spd test1stemmed.new.sph 现在变成.spa .spd .sph 多个索引文件都相互覆盖了 可能是这个原因引起了 那怎么文件只有后缀呢????
HonestQiao
会员
#13 | 发表时间: 2010 03 05 21:52
回复 
路径设置给了路径,最后没有给出前缀
dismissme
会员
#14 | 发表时间: 2010 03 06 02:10
回复 
HonestQiao:
path = /usr/local/coreseek/var/data/

你的意思是说 path = /usr/local/coreseek/var/data/变成这样吗 path = /usr/local/coreseek/var/data/test1 吗
HonestQiao
会员
#15 | 发表时间: 2010 03 06 14:23
回复 
是的
 
回复
Bold Style  Italic Style  Image 链接  URL 链接 

» 帐号  » 密码 
发帖前请登陆, 或者 注册 .