亚马逊产品 API:设置多个关键字

Amazon Product API: Setting Multiple Keyword

我正在为 PHP 使用 ApaiIO API 并且我正在使用以下代码来提取项目列表,但它没有提取项目。当我放置 hadoopJava 时,它会获取。

$apaiIO = new ApaiIO($conf);

$search = new Search();
$search->setCategory('Books');
$search->setCondition('All');
$search->setKeywords('Hadoop Java');

查询是交集,不是并集

它不会重试 "any of hadoop and java" 但带有 "both hadoop and java" 的项目,也许 none

我通过合并 2 个查询的结果解决了类似的情况:

function searchAmazon($keywords){
..... //preamble code
$apaiIO = new ApaiIO($conf);

$search = new Search();
... //setting and filters
$search->setKeywords($keywords);
... //retrieve it and put it in an array or similar    
... //blabla return
}


$products1=searchAmazon($keyword1);

$products2=searchAmazon($keyword2);

$products=merge($products1,$products2);//use some merge algorithm of your choice