在 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
我确信代码解释了一切,不需要添加描述。