使用Google自定义搜索API进行多种文件类型搜索 [英] Multiple file types search using Google Custom Search API

查看:142
本文介绍了使用Google自定义搜索API进行多种文件类型搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获取特定文件类型的Google搜索结果. 例如,在浏览器中,我将直接在Google中搜索" hyperloop文件类型:pdf ",它将列出"Hyperloop"的PDF文件. 为此,我的Google自定义搜索请求URI为

I need to get Google search results for particular filetypes. For example, in browser I would directly google search for "hyperloop filetype:pdf" and it will list out PDF files for "Hyperloop". For this, my Google Custom Search request URI will be https://www.googleapis.com/customsearch/v1?key=MY_KEY&cx=MY_UNIQUE_ID&q=hyperloop&fileType=pdf

但是,目前,我想获取文件类型为.ppt或.doc的"hyperloop"的搜索结果. 在浏览器中,我可以通过搜索" hyperloop文件类型:ppt或文件类型:doc "来实现此目的.

However, currently I would like to get search results for "hyperloop" of filetypes .ppt or .doc. In browser, I would achieve this by googling "hyperloop filetype:ppt OR filetype:doc".

此查询的等效搜索请求URI是什么? 在 Google自定义搜索文档<中,我找不到与对单个参数使用多个值进行查询有关的任何内容/a>.

What will be my Search request URI equivalent for this query? I could not find anything related to querying using multiple values for a single parameter in Google Custom Search Documentation.

推荐答案

而不是

q=hyerloop&filetype=pdf

您可以使用

q=hyperloop%20filetype:pdf%20OR%20filetype:doc

这篇关于使用Google自定义搜索API进行多种文件类型搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆