错误提示:
lyh% ./web/cgi/tool/
search.py Traceback (most recent call last):
File "./web/cgi/tool/
search.py", line 41, in <module>
print search(query='', index='makeup_fine', limit=30, debug=True, filtervals=[('attribute_id', [1])] )
File "./web/cgi/tool/
search.py", line 31, in search
res = cl.Query ( argvs['query'], argvs['index'] )
File "/Users/sdjl/aoaola/web/cgi/tool/
sphinxapi.py", line 502, in Query
results = self.RunQueries()
File "/Users/sdjl/aoaola/web/cgi/tool/
sphinxapi.py", line 639, in RunQueries
response = self._GetResponse(sock, VER_COMMAND_SEARCH)
File "/Users/sdjl/aoaola/web/cgi/tool/
sphinxapi.py", line 245, in _GetResponse
(status, ver, length) = unpack('>2HL', sock.recv(8))
socket.timeout: timed out
环境:
mac lion
brew install sphinx
python 调用官方api
相同的配置在linux下没问题
部分config文件:
indexer
{
mem_limit = 32M
}
searchd
{
listen = 9312
#port = 9312
log = /opt/aoaola/sphinx/log
query_log = /opt/aoaola/sphinx/query_log
read_timeout = 5
client_timeout = 300
max_children = 30
pid_file = /opt/aoaola/sphinx/pid_file
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
mva_updates_pool = 1M
max_packet_size = 8M
max_filters = 256
max_filter_values = 4096
max_batch_queries = 32
workers = threads # for RT to work
}
其中/opt/aoaola/sphinx/query_log文件没有内容
tail -10 /opt/aoaola/sphinx/log 为:
[Tue Jul 31 11:10:38.817 2012] [ 685] binlog: finished replaying /usr/local/var/data/binlog.001; 0.0 MB in 0.000 sec
[Tue Jul 31 11:10:38.817 2012] [ 685] binlog: finished replaying total 2 in 0.000 sec
[Tue Jul 31 11:10:38.817 2012] [ 685] accepting connections
[Tue Jul 31 11:20:29.575 2012] [ 685] caught SIGTERM, shutting down
[Tue Jul 31 11:20:32.747 2012] [ 685] shutdown complete
[Tue Jul 31 11:20:32.748 2012] [ 684] Child process 685 has been forked
[Tue Jul 31 11:20:32.749 2012] [ 684] Child process 685 has been finished, exit code 0. Watchdog finishes also. Good bye!
[Tue Jul 31 11:20:37.709 2012] [ 738] Child process 739 has been forked
[Tue Jul 31 11:20:37.709 2012] [ 739] listening on all interfaces, port=9312
[Tue Jul 31 11:20:37.756 2012] [ 739] accepting connections
用search测试:
lyh% search -i makeup_fine "粉底液"
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (
http://sphinxsearch.com)
using config file '/usr/local/Cellar/sphinx/2.0.4/etc/sphinx.conf'...
index 'makeup_fine': search error: .
郁闷了。。。 求助。。。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.