0

我正在将 bing search api 集成到我的网站中。我正在使用必应图像搜索。它对我来说很好,但是当我从网站上搜索图像时,我遇到了一个大问题。问题详情如下

$query= 'kamen rider site: http://p-bandai.jp/';
$query = urlencode("'$query'");

当我从 bing api 搜索这个时,所有正确的图像都出现了。但是当我搜索这个关键字时,我没有任何结果。代码如下

$query= 'tomica disney site: http://p-bandai.jp/';
$query = urlencode("'$query'");

我得到了创建地方的问题。但我不知道如何解决这个问题。

问题:当我搜索时,tomica disney site: http://p-bandai.jp/我没有得到任何结果。但是当我搜索时,tomica disneysite: http://p-bandai.jp/我得到了结果。请给我任何解决方案。

4

1 回答 1

0

You are not getting any results because Bing does not have anything in index for that website and query. Check it out: http://www.bing.com/images/search?q=tomica%20disney%20site%3Ap-bandai.jp

site: limits results to be coming only from one website. Since, in second case, you don't have a space between Disney and site:, site: constraint is not working and results returned from index of the all websites.

To summarize: Bing (and Google as well) does not have anything in index for website p-Bandai.jp for query 'tamica disney'. In second case it works only because you mistyped query and site: constraint is not actually applied.

于 2014-10-24T23:11:17.357 回答