Marty Aghajanyan
Marty Aghajanyan

Reputation: 13389

Sphinx mysql " WHERE IN " for string colums

Is there any way to perform the following query in sphinx index.

SELECT * FROM search_index WHERE MATCH('sea*') AND object_type IN ('news', 'videos') LIMIT 0, 7

This query doesnt work and throw the following error

sphinxql: syntax error, unexpected QUOTED_STRING, expecting CONST_INT or '-' near ''news', 'videos') LIMIT 0, 7 '

Upvotes: 0

Views: 1147

Answers (1)

barryhunter
barryhunter

Reputation: 21091

I think very latest version of sphinx (released a few days ago) supports that, but not totally sure.


But you could also just use fields rather than attributes, then can do it in the full-text query

SELECT * FROM search_index WHERE MATCH('sea* @object_type (news|videos)') LIMIT 0, 7

Upvotes: 1

Related Questions