Ruby on rails 为什么';亚马逊ecs';当搜索字符串太详细时,gem是否不返回结果?
我正在尝试从gem中提取搜索结果。我的搜索字符串有问题,但只有当它太详细的时候 现在假设用户输入此搜索:Ruby on rails 为什么';亚马逊ecs';当搜索字符串太详细时,gem是否不返回结果?,ruby-on-rails,search,amazon,amazon-product-api,Ruby On Rails,Search,Amazon,Amazon Product Api,我正在尝试从gem中提取搜索结果。我的搜索字符串有问题,但只有当它太详细的时候 现在假设用户输入此搜索: search_string = 'big book of birth' 在这种情况下,这是可行的: res = Amazon::Ecs.item_search(search_string, {:response_group => 'Large', :search_index => 'Books'}) search_string = 'big book of birth
search_string = 'big book of birth'
在这种情况下,这是可行的:
res = Amazon::Ecs.item_search(search_string, {:response_group => 'Large', :search_index => 'Books'})
search_string = 'big book of birth by'
res = Amazon::Ecs.item_search(search_string, {:response_group => 'Large', :search_index => 'Books'})
res.has_error?
=> false
换句话说,在我的控制台中,我得到以下信息:
res.has_error?
=> false
即使这样也行得通:
res = Amazon::Ecs.item_search(search_string, {:response_group => 'Large', :search_index => 'Books'})
search_string = 'big book of birth by'
res = Amazon::Ecs.item_search(search_string, {:response_group => 'Large', :search_index => 'Books'})
res.has_error?
=> false
奇怪的是,这不起作用:
search_string = 'big book of birth by erika lyons'
res = Amazon::Ecs.item_search(search_string, {:response_group => 'Large', :search_index => 'Books'})
res.has_error?
=> true
res.error
=> "We did not find any matches for your request."
我是否需要包括一些选项/参数,以使此搜索像Amazon.com上的搜索一样“模糊”(例如拼写检查、截断不必要的单词等)?在那里,搜索“埃里卡·莱昂斯的出生大书”在的确切书里找到了亚马逊产品广告API,结果是亚马逊产品广告API简单