当我运行indexer -all
时,我没有收到任何错误,但是我也无法看到它。
indexer --all
using config file '/etc/sphinx/sphinx.conf'...
indexing index 'indtest'...
collected 4 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 4 docs, 193 bytes
total 0.008 sec, 21627 bytes/sec, 448.22 docs/sec
skipping non-plain index 'testrt'...
total 4 reads, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
total 12 writes, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
在sphinx.conf中,我给出了:
source src1
{
type = mysql
sql_host = <myhostname>
sql_user = <myusername>
sql_pass = <mypass>
sql_db = test
sql_port = 3306 # optional, default is 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
}
index indtest
{
source = src1
path = /mypath/sphinx/data/indtest
}
我检查了给定的路径,创建了9个indtest文件,扩展名为spa,spd,spe,sph,spi,spk,spm,spp,sps。
但是当我在连接到searchd(show tables;
)后触发mysql -h0 -P9306
时,我看不到我的索引。可能是什么问题和解决方案?是否与文件访问权限问题有关?
答案 0 :(得分:0)
--rotate
选项运行索引器时遇到问题。运行indexer --rotate --all
后抛出错误
WARNING: failed to open pid_file '/mypath/sphinx/log/searchd.pid'.
WARNING: indices NOT rotated.
当试图停止搜索时,/usr/bin/searchd --stop
,我得到了
FATAL: stop: pid file '/mypath/sphinx/log/searchd.pid' does not exist or is not readable
最后,杀死了这个过程并重新开始。
感谢@barryhunter的帮助。我是新手,所以我可能花了太多时间来解决问题。