使用 Google 自定义搜索 API 进行多种文件类型搜索 [英] Multiple file types search using Google Custom Search API
问题描述
我需要获取特定文件类型的 Google 搜索结果.例如,在浏览器中,我会直接谷歌搜索hyperloop filetype:pdf",它会列出Hyperloop"的 PDF 文件.为此,我的 Google 自定义搜索请求 URI 将是 https://www.googleapis.com/customsearch/v1?key=MY_KEY&cx=MY_UNIQUE_ID&q=hyperloop&fileType=pdf
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 filetype:ppt OR filetype: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 自定义搜索文档<中找不到与使用单个参数的多个值进行查询相关的任何内容.
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屋!