0

I am new in sphinx and mysql and trying to execute simple query as shown below

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

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'

VVB
  • 7,363
  • 7
  • 49
  • 83

1 Answers1

1

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.

The slash shouldn't have ANYTHING after it - as it's meant to be 'escaping' the end of line itself.

barryhunter
  • 20,886
  • 3
  • 30
  • 43