各位大神:
   小弟在win7 64bit  下,用coreseek3.2.14 做增量索引的测试,测试发现在数据库中insert一条记录后,然后更新增量索引 delta, 但是delta索引并没有变化,相应的merge 也没有变化。哪位大神能否帮忙看看。 谢谢配置文件如下:#源定义
source main
{
    type                    = mysql    sql_host                = localhost
    sql_user                = root
    sql_pass                = root
    sql_db                    = beauty_local2
    sql_port                = 3306
    sql_query_pre            = SET NAMES utf8
    sql_query_pre      = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM documents    sql_query                = SELECT id, title, content FROM documents \
WHERE id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
                                                              #sql_query第一列id需为整数
                                                              #title、content作为字符串/文本字段,被全文索引    sql_query_info_pre      = SET NAMES utf8                                        #命令行查询时,设置正确的字符集
    sql_query_info            = SELECT * FROM documents WHERE id=$id #命令行查询时,从数据库读取原始数据信息
}source delta : main
{
    type                    = mysql    sql_host                = localhost
    sql_user                = root
    sql_pass                = root
    sql_db                    = beauty_local2
    sql_port                = 3306
    sql_query_pre            = SET NAMES utf8
    sql_query_pre      = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM documents    sql_query                = SELECT id, title, content FROM documents \
WHERE id>( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
                                                              #sql_query第一列id需为整数
                                                              #title、content作为字符串/文本字段,被全文索引    sql_query_info_pre      = SET NAMES utf8                                        #命令行查询时,设置正确的字符集
    sql_query_info            = SELECT * FROM documents WHERE id=$id #命令行查询时,从数据库读取原始数据信息
}#index定义
index main
{
    source            = main             #对应的source名称
    path            = var/data/mysqlmain #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
    docinfo            = extern
    mlock            = 0
    morphology        = none
    min_word_len        = 1
    html_strip                = 0    #中文分词配置,详情请查看:http://www.coreseek.cn/products-install/coreseek_mmseg/
    #charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾
    charset_dictpath = etc/                             #Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/...
    charset_type        = zh_cn.utf-8
}index delta : main
{
    source            = delta             #对应的source名称
    path            = var/data/mysqldelta #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
    docinfo            = extern
    mlock            = 0
    morphology        = none
    min_word_len        = 1
    html_strip                = 0    #中文分词配置,详情请查看:http://www.coreseek.cn/products-install/coreseek_mmseg/
    #charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾
    charset_dictpath = etc/                             #Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/...
    charset_type        = zh_cn.utf-8
}#全局index定义
indexer
{
    mem_limit            = 128M
}#searchd服务定义
searchd
{
    listen                  =   9312
    read_timeout        = 5
    max_children        = 30
    max_matches            = 1000
    seamless_rotate        = 0
    preopen_indexes        = 0
    unlink_old            = 1
    pid_file = var/log/searchd_mysql.pid  #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
    log = var/log/searchd_mysql.log        #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
    query_log = var/log/query_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
}

解决方案 »

  1.   

    var/data/mysqldelta 这个不是win7下的路径吧,这是linux 路径,没在window下配置过,Linux 倒是配置过
      

  2.   

    你的增量索引建立就有问题,明确告诉你,你对sphinx的如何实时建立增量索引还不是很明白。
    source delta中请把 sql_query_pre      = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM documents这句去掉,不然delta根本不起作用。
    对于你所说的,全量也不生效,请检查下你新插入的数据id是否自增。
      

  3.   

    建议还是好好看看文档吧:http://www.coreseek.cn/docs/coreseek_4.1-sphinx_2.0.1-beta.html#live-updates
      

  4.   


    1, 非常感谢,delta 中 sql_query_pre      = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM documents  这句确实不能加,不然增量索引永远查不到数据了,粗心了。
    2, 之前是说的merge不生效,因为每次 indexer  delta 都没数据, merge 当然没什么用了,如果 indexer main 是可能有效果的。