1

$result is an array

$sphinx_ranked = SphinxQL::create($conn)->select('*')->from('jobs')->where('id', 'IN', $result)->execute();

after executing I got error

[1064] index jobs: unsupported filter type '(filter-type-6)' on @id [ SELECT * FROM jobs WHERE id IN ('57', '59')]

If I try this

SELECT * FROM jobs WHERE id IN (57,59);

Then this works. But I want dynamic values to be passed. Any Help would be appreciated.

Joy
  • 301
  • 1
  • 5
  • 15
  • 2
    What does `$result` contain? is it an array of strings? it should be an array of numeric values. Seems the builder calls quoteArr on the list that calls ->quote() on each value. If strings it will string quote it) - maybe use var_dump() on it to see if strings or numbers – barryhunter Aug 16 '17 at 14:33

1 Answers1

0

Sphinx require more accurate approach to control types of variables. Try next:

$sphinx_ranked = SphinxQL::create($conn)
    ->select('*')
    ->from('jobs')
    ->where('id', 'IN', array_map('intval', $result)) // <- int[] instead of string[]
    ->execute(); 
Nick
  • 9,735
  • 7
  • 59
  • 89