我首先尝试标准的网络搜索,如下图,它返回476个结果
我有自定义的Google ruby api 客户端,并有自定义搜索引擎和 api 密钥设置。
这是我的查询
client = Google::APIClient.new(application_name: 'Foo',
application_version: 1,
:authorization => nil)
search = client.discovered_api('customsearch')
result = client.execute(
search.cse.list,
'key' => 'xxxxx.xxxx_xxxxx_mykey',
'q' => 'chateau palmer',
'siteSearch' => 'nytimes.com',
'siteSearchFilter' => 'i',
'cx' => 'my_custom_Search key'
)
total = result.data.queries.request.collect {|i| i['totalResults']}
我得到的结果在计数上完全不同,可能是什么原因?