首页 > 其他 > 详细

处理Sphinx(Coreseek)Query failed: index xxxx: sort-by attribute 'xxxx' not found

时间:2020-05-18 00:12:55      阅读:80      评论:0      收藏:0      [点我收藏+]

Sphinx在使用的时候报错Query failed: index xxxx: sort-by attribute ‘xxxx‘ not found。第一个xxxx是索引的名称,第二个xxxx是字段的名称。

出现这个问题的原因是:在索引中没有查找到要排序检索的字段。

但是奇怪的是明明在创建索引文件的时候添加了这个字段,经过排查之后发现排序和检索用的是同一个字段,会起冲突。

解决方法:

在配置文件中给该字段添加一个别名:举个例子create_time字段

sql_query = SELECT note_id,title,types,status,create_time,create_time as sort_time,FROM notes where (status=200 or status = 800)

ok,搞定!

处理Sphinx(Coreseek)Query failed: index xxxx: sort-by attribute 'xxxx' not found

原文:https://www.cnblogs.com/yuanwanli/p/12907782.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!