第一个报错:WARNING: key 'sql_query' is not multi-value; value in E:/Lnmp/Bin/Sphinx/sphinx.本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
using config file 'E:/Lnmp/Bin/Sphinx/sphinx.conf'... WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details. indexing index 'test1'...本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
报错提示:配置项sql_query_info已经被配置文件中永久移除,这是Sphinx 2.2.10-id64-release (2c212e0)版本的一些修改,另外被移除的配置项还有charset_type设置。本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
第二个报错:FATAL: failed to lock E:/Lnmp/Cache/Sphinx/test.spl: No error, will not index. T本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
using config file 'E:/Lnmp/Bin/Sphinx/sphinx.conf'... indexing index 'test1'... FATAL: failed to lock E:/Lnmp/Cache/Sphinx/test.spl: No error, will not index. Try --rotate option.报错提示:无法锁定文件test.spl,这是因为建索引时,则需要锁定索引spl文件,而如果正在提供搜索服务,则这个文件无法锁定。所以报此错,正确的解决办法是在建索引命令后加参数:--rotate 可以在不停searchd的情况下索引。--rotate send SIGHUP to searchd when indexing is over to rotate updated indexes automatically。本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
第三个报错:WARNING: attribute 'id' not found - IGNORING
本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
using config file 'E:/Lnmp/Bin/Sphinx/sphinx.conf'...
indexing index 'test1'...
WARNING: attribute 'id' not found - IGNORING
total 0 docs, 0 bytes
total 0.051 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
报错提示:属性id未找到,因为我的SQL是sql_query=select id,title from webinfo,id是表的主键。而在索引配置中又有sql_attr_uint = id ,而sphinx是不能使用主键来做属性字段,解决方法:可以去掉sql_attr_uint = id 这行配置,或者把SQL改成sql_query = SELECT id,id as ids,.. from 表,然后配置里再使用:sql_attr_uint = ids
第四个报错:ERROR: index 'test1': No fields in schema - will not index.本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
using config file 'E:/Lnmp/Bin/Sphinx/sphinx.conf'...
indexing index 'test1'...
ERROR: index 'test1': No fields in schema - will not index.
total 0 docs, 0 bytes
total 0.019 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
报错提示:在模式中没有字段,不会索引。简单理解一下,因为我的SQL是:sql_query=select id,id as ids,title, from webinfo,而id和title都当做属性被索引,sphinx搜索是想通过索引项,然后查询出其它的非索引 项,即id和title都被索引了,通过id,title搜索出来的结果里有什么呢?就是没有其它的字段可供搜索出来,索引也没什么意义。所以需要更改sql,增加查询的字段,如:sql_query=select id,id as ids,title,url,keywords,description from webinfo 即可。本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
sphinx在使用时遇见的错误肯定不只这几个,这里只是列了一些我遇到的并通过解决方法解决了的报错。本文地址:http://www.04007.cn/article/256.html,未经许可,不得转载.
本文地址:http://www.04007.cn/article/256.html 未经许可,不得转载. 手机访问本页请扫描右下方二维码.
![]() |
![]() |
手机扫码直接打开本页面 |