Updating my code like so and it works perfectly
<?php
$products_cookie = json_decode($_COOKIE['compare-products'], true);
$allKeys = array_keys($products_cookie); // see https://stackoverflow.com/a/4095810/175553
$allKeys = str_replace('ITEM-','',$allKeys); // see https://stackoverflow.com/a/4977085/175553
$productIDCollection = implode(', ',$allKeys);
?>
<?php
$searchrsDataSet_1 = new WA_MySQLi_Search("rsDataSet","0=0");
if (true) {
$searchrsDataSet_1->clearSearch();
$searchrsDataSet_1->setSearch(array("type"=>"Key", "comparison"=>"=", "join"=>"AND", "or"=>", ", "or"=>" ", "start_encap"=>"\"", "end_encap"=>"\""), array("id"), "i", "".$productIDCollection ."");
}
?>
Thanks Ray that put me on the right track, it never occurred to me to use a Keyword search for an integer.
Just as a FYI the wizard doesn't give me a choice for integer only Text, Number Boolean or Date and when I choose Number/Boolean it inserts a "d" rather than what I think should be an "i" as the identifier for the type of field it is looking for. Is that correct as I always go back and modify it to an "i" by hand afterwards.