• 3.2k

Sphinx ERROR: malformed or unknown option near '--merge-klists'.

Sphinx2.x 升级到Sphinx3,在Win7上安装Sphinx3.1.1进行测试,无法将 delta 增量索引中已移除的数据从 全量索引main中移除,在Sphinx2.x中是完全可以。

共2个表 documents(id...) sphinx(tb,id,type)
执行步骤:

indexer.exe -c d:/sphinx3.conf --all # 生成增量索引
searchd.exe -c d:/sphinx3.conf & # 启动
# 在表documents中加入一条记录id=12,移除id=1记录。在表sphinx中 增加2条记录('doc',1,0),('doc',12,1) 
# 执行增量索引生成
indexer.exe -c d:/sphinx3.conf delta --rotate

# 执行合并增量索引到全量索引
indexer.exe -c d:/sphinx3.conf --merge main delta --merge-klists --rotate # 报错如标题

配置文件sphinx3.conf 如下


source src1
{
    type            = mysql

    sql_host        = localhost
    sql_user        = root
    sql_pass        = 000000
    sql_db            = test
    sql_port        = 3306

    sql_query        = \
        SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
        FROM documents

    sql_attr_uint        = group_id
    sql_attr_timestamp    = date_added
}

source src1delta : src1 {
    sql_query = \
        SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
        FROM documents WHERE id in (select id FROM sphinx where tb='doc' AND type=1 )

    sql_query_killlist = SELECT id FROM sphinx WHERE tb='doc' AND type=0
    sql_query_post = DELETE FROM sphinx WHERE tb='doc'
}

index main
{
    source    = src1
    path    = d:/sphinx3/data/main
}

index delta {
    source = src1delta
    path = d:/sphinx3/data/delta
    kbatch = main
    kbatch_source = id
}


index rt
{
    type            = rt
    rt_mem_limit    = 128M

    path            = d:/sphinx3/data/rt

    rt_field        = title
    rt_field        = content
    rt_attr_uint    = gid
}


indexer
{
    mem_limit        = 128M
}


searchd
{
    listen            = 9312
    listen            = 9306:mysql41
    log            = d:/sphinx3/log/searchd.log
    query_log        = d:/sphinx3/log/query.log
    read_timeout        = 5
    max_children        = 30
    pid_file        = d:/sphinx3/log/searchd.pid
    seamless_rotate        = 1
    preopen_indexes        = 1
    unlink_old        = 1
    workers            = threads
    binlog_path        = d:/sphinx3/data
}
阅读 1.2k
评论
    0 个回答
    撰写回答

    登录后参与交流、获取后续更新提醒

    相似问题
    推荐文章