我用PHP測試獅身人面像(教程:http://www.siteduzero.com/informatique/tutoriels/creer-un-moteur-de-recherche-avec-sphinx-et-php)在PHP中使用Sphinx。 「搜索」錯誤:「搜索錯誤:。」
如果我運行 「搜索」 是這樣的:
search -i news navigateur
我有以下錯誤:
index 'news': search error: .
索引器作品罰款:
$ sudo indexer news
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/share/php/sphinx/etc/sphinx.conf'... indexing index 'news'...
collected 57 docs, 0.7 MB sorted 0.1 Mhits, 100.0%
done total 57 docs, 689264 bytes total 0.050 sec, 13684561 bytes/sec, 1131.67 docs/sec
total 3 reads, 0.000 sec, 115.5 kb/call avg, 0.1 msec/call avg
total 9 writes, 0.000 sec, 83.5 kb/call avg, 0.0 msec/call avg
而且,用th e API,PHP代碼不會返回任何內容。有人已經有這個錯誤?
這裏的配置文件:
index news {
source = news path = /usr/share/php/sphinx/var/data/news
}
indexer {
mem_limit = 32M
}
searchd {
port = 3312 log = /usr/share/php/sphinx/var/log/searchd/searchd.log query_log = /usr/share/php/sphinx/var/log/searchd/query.log pid_file = /usr/share/php/sphinx/var/log/searchd/searchd.pid
}
source news {
type = mysql sql_host = localhost sql_user = root sql_pass = sql_db = siteduzero_sphinx sql_query_pre = SET NAMES utf8 sql_query = SELECT id\ , categorie\ , titre\ , contenu FROM news sql_attr_uint = categorie sql_query_info = SELECT titre FROM news WHERE id=$id }
感謝。
法布里斯