sql - SQLSTATE [42000]:语法错误或访问冲突:1584 调用存储函数“sphinx_snippets”中的参数不正确
问题描述
在我的 Laravel 脚本中使用 sphinx 搜索单词会返回此错误:
SQLSTATE[42000]: Syntax error or access violation: 1584 Incorrect parameters in the call to stored function 'sphinx_snippets' (SQL: select articles.*, sphinx_snippets(articles.title, 'articles', 'dff', 280 AS `limit`, 8 AS around, '<span class="highlight">' AS before_match, '</span>' AS after_match) as title_snippet, sphinx_snippets(articles.abstract, 'articles', 'dff', 280 AS `limit`, 8 AS around, '<span class="highlight">' AS before_match, '</span>' AS after_match) as abstract_snippet from `articles_index` inner join `articles` on `articles_index`.`id` = `articles`.`id` where articles_index.query = '@* dff;sort=relevance;fieldweights=title,2,abstract,1,keywords,10;mode=extended;offset=0;
limit=25')
解决办法是什么。
我也通过终端在 mysql 中运行此代码
select articles.*, sphinx_snippets(articles.title, 'articles', 'dff') as title_snippet from articles;
得到错误:
错误 1305 (42000):函数 database_name.sphinx_snippets 不存在
解决方案
推荐阅读
- python - 有没有办法在python中安装包后下载包资源?
- mysql - mysql的日期时间值不正确
- java - 扫描仪使用循环从命令行读取文本文件,但循环不会中断
- python - django 创建客户端用户
- excel - 将粘贴值和格式从一张表复制到另一张表时出现 VBA 错误 1004
- asp.net - Hangfire:看起来工作被中止了
- php - 在 Mac 上为 Laravel 7 / Homestead 更新 PHP 到 7.2.5
- webpack - Webpack 需要一个合适的加载器来处理这个文件类型错误
- python - 我的数据库已经有 20 行,但是当我保存新行时,它们的 id 从 1 开始
- django - 如何告诉我的序列化程序可以将字段留空?