0

在 Sphinx 上将索引与 delta 合并时,出现此错误:

~: /usr/local/bin/indexer --merge myindex myindexDelta --rotate;
Sphinx 2.0.6-release (r3473)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc ( http://sphinxsearch.com )

using config file '/usr/local/etc/sphinx.conf'...
merging index 'myindexDelta' into index 'myindex'...
read 414.6 of 414.6 MB, 100.0% done
FATAL: failed to merge index 'myindexDelta' into index 'myindex': failed to open /server/sphinx/data/myindex.sps: No such file or directory

我在 sphinx.conf 上的配置如下

source myindex
{
     type = mysql
     sql_host = localhost
     sql_user = db
     sql_pass =
     sql_db     = db
     sql_query_pre = SET SESSION query_cache_type=OFF
     sql_query_pre  = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM mytable
     sql_query_pre  = SET NAMES utf8

     sql_query = \
                 SELECT  id,title FROM mytable \
                 WHERE id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
     sql_ranged_throttle = 0
}

source myindexDelta : myindex
{
     sql_query_pre = SET SESSION query_cache_type=OFF
     sql_query_pre = SET NAMES utf8
     sql_query = \
             SELECT  id,title FROM mytable \
             WHERE id > ( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
}

index myindex
{
     source = myindex
     path = /server/sphinx/data/myindex
     min_word_len = 3
     min_infix_len = 0
}

index myindexDelta : myindex
{
     source = myindexDelta
     path = /server/sphinx/data/myindexDelta
     min_word_len = 3
     min_infix_len = 0
}

索引具有权限的文件列表:

~: ls -lh /server/sphinx/data/
-rw-r--r-- 1 root root    0 Nov 11 21:40 myindexDelta.spa
-rw-r--r-- 1 root root 290K Nov 11 21:40 myindexDelta.spd
-rw-r--r-- 1 root root  328 Nov 11 21:40 myindexDelta.sph
-rw-r--r-- 1 root root 106K Nov 11 21:40 myindexDelta.spi
-rw-r--r-- 1 root root    0 Nov 11 21:40 myindexDelta.spk
-rw------- 1 root root    0 Nov 11 21:40 myindexDelta.spl
-rw-r--r-- 1 root root    0 Nov 11 21:40 myindexDelta.spm
-rw-r--r-- 1 root root 223K Nov 11 21:40 myindexDelta.spp
-rw-r--r-- 1 root root    1 Nov 11 21:40 myindexDelta.sps
-rw-r--r-- 1 root root    0 Jul  3 21:17 myindex.spa
-rw-r--r-- 1 root root 7.0G Jul  3 23:54 myindex.spd
-rw-r--r-- 1 root root  290 Jul  3 23:54 myindex.sph
-rw-r--r-- 1 root root 397M Jul  3 23:54 myindex.spi
-rw-r--r-- 1 root root    0 Jul  3 23:54 myindex.spk
-rw------- 1 root root    0 Nov 11 21:08 myindex.spl
-rw-r--r-- 1 root root    0 Jul  3 21:17 myindex.spm
-rw-r--r-- 1 root root 9.2G Jul  3 23:54 myindex.spp

我确信代码解释了一切,不需要添加描述。

4

1 回答 1

2

我猜原来的'myindex'是由不同版本的狮身人面像制作的。(即认为 2.0.6-release 不会在 7 月发布)

在该版本更新的某个地方,对 .sps 文件的要求发生了变化——新版本需要它,而旧版本不需要。您没有字符串属性,因此文件在增量中不包含数据。

我建议使用您当前版本的索引器重建 myindex - 所以它们的版本是相同的。

或者,也许您可​​以尝试将myindexDelta.sps复制到myindex.sps。它不包含任何数据(1 个虚拟字节!),因此它不应该损坏任何东西。只需要这样做一次。

于 2012-11-12T13:49:15.523 回答