简体   繁体   English

错误:sphinx查询中的未知键名“ CONCAT_WS”

[英]ERROR: unknown key name 'CONCAT_WS' in sphinx query

I am new in sphinx and mysql and trying to execute simple query as shown below 我是sphinx和mysql的新手,并尝试执行简单的查询,如下所示

sql_query               = \
                (SELECT users.id AS uid, \ 
                CONCAT_WS(' ', users.fname, users.lname, users.email) AS data \
                FROM users) \
                UNION ALL \
                (SELECT documents.id AS diid, documents.description \
                FROM documents);

But I am getting below error CONCAT_WS on indexing command 但是我在索引命令下遇到错误CONCAT_WS

ERROR: unknown key name 'CONCAT_WS' in /etc/sphinxsearch/sphinx.conf line 12 col 26. FATAL: failed to parse config file '/etc/sphinxsearch/sphinx.conf' 错误:/etc/sphinxsearch/sphinx.conf行12 col 26中的未知键名'CONCAT_WS'。致命:无法解析配置文件'/etc/sphinxsearch/sphinx.conf'

You have a space AFTER the slash on the line before 您在行前的斜线后有一个空格

            (SELECT users.id AS uid, \ 
                             ---------^

So Sphinx thinks the CONCAT_WS is starting a whole new line, rather than just continuing the line before. 因此Sphinx认为CONCAT_WS正在开始全新的生产线,而不是仅仅在之前继续生产。

The slash shouldn't have ANYTHING after it - as it's meant to be 'escaping' the end of line itself. 斜线后应该没有任何内容-因为它是要“转义”行尾本身。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM