热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

自定义搜索引擎_如何创建自己的自定义Google搜索引擎

自定义搜索引擎HaveyoueverwantedtocreateacustomGooglesearchenginethatsearchesonlyspecificwebsites?
自定义搜索引擎

自定义搜索引擎

image

Have you ever wanted to create a custom Google search engine that searches only specific websites? You can easily do this with Google’s Custom Search Engine tool. You can bookmark your search engine and even share it with other people.

您是否曾经想过创建仅搜索特定网站的自定义Google搜索引擎? 您可以使用Google的“自定义搜索引擎”工具轻松完成此操作。 您可以为搜索引擎添加书签,甚至可以与他人共享。

This trick works similarly to Google’s site: operator, but you won’t have to type the operator every time you search. It’s particularly useful if you want to search a large number of sites at once.

此技巧的用法类似于Google的站点:operator ,但是您不必在每次搜索时都键入运算符。 如果要一次搜索大量站点,此功能特别有用。

创建自定义搜索引擎 (Creating a Custom Search Engine)

To get started, head over to the Google Custom Search Engine page and click the Create a custom search engine button. You’ll need a Google account for this – the search engine will be saved with your Google account.

首先,请转到Google自定义搜索引擎页面,然后单击创建自定义搜索引擎按钮。 为此,您需要一个Google帐户-搜索引擎将与您的Google帐户一起保存。

image

Enter a name and description for your search engine – these can be anything you like.

输入搜索引擎的名称和描述-您可以随意输入。

image

The Sites to search field is the one that really matters. Here, you’ll specify a list of the websites you want to search. For example, if you wanted to search both howtogeek.com and microsoft.com, you’d enter:

要搜索网站”字段确实很重要。 在这里,您将指定要搜索的网站列表。 例如,如果您要搜索howtogeek.com和microsoft.com,请输入:

howtogeek.com/*

howtogeek.com/*

microsoft.com/*

microsoft.com/*

The * character is the wildcard, which can match anything, so the /* characters tell your search engine to search everything on both of these websites.

*字符是通配符,可以匹配任何内容,因此/ *字符告诉您的搜索引擎搜索这两个网站上的所有内容。

There are more advanced things you can do with this box – we’ll get back to that in a bit.

您可以使用此框执行更高级的操作-我们稍后再讨论。

image

After clicking Next, you can specify a style for your search results and test the search engine you created.

单击“下一步”后,您可以为搜索结果指定样式并测试您创建的搜索引擎。

image

Once you’re happy with your search engine, click the Next button at the bottom of the page and you’ll end up at a page that gives you an embed code for your search engine.

对搜索引擎感到满意之后,请单击页面底部的“下一步”按钮,您将最终到达一个为您的搜索引擎提供嵌入代码的页面。

You’re probably not a web developer, so you’ll want to ignore this page. Click the Google Custom Search logo at the top of the page instead.

您可能不是网络开发人员,所以您将忽略此页面。 而是点击页面顶部的Google自定义搜索徽标。

image

To get to your search engine’s page, click its name in the list of search engines you’ve created.

要进入搜索引擎页面,请在您创建的搜索引擎列表中单击其名称。

image

You can bookmark this page for easy access your search engine. You can also share your search engine with anyone by sending them the full URL that appears in your address bar.

您可以在此页面上添加书签,以方便访问搜索引擎。 您还可以通过向他们发送地址栏中显示的完整URL,与任何人共享搜索引擎。

image

URL技巧 (URL Tricks)

You don’t have to specify an entire website while creating your custom search engine.

创建自定义搜索引擎时,您不必指定整个网站。

For example, the custom search engine above searches all areas of microsoft.com. If we do an example search, we might see that there’s useful information coming from windows.microsoft.com and support.microsoft.com, but the results from answers.microsoft.com (Microsoft’s support forum) are not very helpful.

例如,上面的自定义搜索引擎搜索microsoft.com的所有区域。 如果我们进行示例搜索,我们可能会发现有一些有用的信息来自windows.microsoft.comsupport.microsoft.com ,但是answers.microsoft.com (Microsoft的支持论坛)的结果不是很有帮助。

image

To exclude answers.microsoft.com and include the other subdomains, we could use the following URL list while creating a search engine:

为了排除Answers.microsoft.com并包括其他子域,我们可以在创建搜索引擎时使用以下URL列表:

howtogeek.com/* windows.microsoft.com/* support.microsoft.com/*

howtogeek.com/* windows.microsoft.com/* support.microsoft.com/*

Note that there’s no way to exclude a specific subdomain – we can only include the ones we want to search. This list will search only the two subdomains on microsoft.com.

请注意,无法排除特定的子域-我们只能包含要搜索的子域。 此列表将仅搜索microsoft.com上的两个子域。

image

There are several other types of URLs you can define in this list:

您可以在此列表中定义其他几种URL:

  • Single Page: You can define only one specific page by entering its URL, such as example.com/page.html. This will include only a single web page in the search engine.

    单页 :您只能通过输入URL来定义一个特定页面,例如example.com/page.html 。 这将仅在搜索引擎中包含一个网页。

  • Part of a Website: You can use the * character in other ways. For example, the URL support.microsoft.com/kb/* will search only Microsoft Knowledge Base articles. Using the URL example.com/*word* will search all pages on example.com that have word in their URLs.

    网站的一部分 :您可以通过其他方式使用*字符。 例如,URL support.microsoft.com/kb/*将仅搜索Microsoft知识库文章。 使用URL example.com/*word*将搜索example.com上URL中包含单词的所有页面。

You can continue fine-tuning the search engine until you’re happy with the results by clicking the back to step 1 link, modifying the URLs, and then performing another test search.

您可以继续微调搜索引擎,直到对结果满意为止,方法是单击返回到步骤1的链接,修改URL,然后执行另一个测试搜索。

image

Once you’re done, you can even add your custom search engine to your browser’s search bar.

完成后,您甚至可以将自定义搜索引擎添加到浏览器的搜索栏中 。

翻译自: https://www.howtogeek.com/124703/how-to-create-your-own-custom-google-search-engine/

自定义搜索引擎



推荐阅读
  • 根据最新发布的《互联网人才趋势报告》,尽管大量IT从业者已转向Python开发,但随着人工智能和大数据领域的迅猛发展,仍存在巨大的人才缺口。本文将详细介绍如何使用Python编写一个简单的爬虫程序,并提供完整的代码示例。 ... [详细]
  • DNN Community 和 Professional 版本的主要差异
    本文详细解析了 DotNetNuke (DNN) 的两种主要版本:Community 和 Professional。通过对比两者的功能和附加组件,帮助用户选择最适合其需求的版本。 ... [详细]
  • 作为一名专业的Web前端工程师,掌握HTML和CSS的命名规范是至关重要的。良好的命名习惯不仅有助于提高代码的可读性和维护性,还能促进团队协作。本文将详细介绍Web前端开发中常用的HTML和CSS命名规范,并提供实用的建议。 ... [详细]
  • 本文探讨了在通过 API 端点调用时,使用猫鼬(Mongoose)的 findOne 方法总是返回 null 的问题,并提供了详细的解决方案和建议。 ... [详细]
  • 本文详细介绍了在企业级项目中如何优化 Webpack 配置,特别是在 React 移动端项目中的最佳实践。涵盖资源压缩、代码分割、构建范围缩小、缓存机制以及性能优化等多个方面。 ... [详细]
  • 中科院学位论文排版指南
    随着毕业季的到来,许多即将毕业的学生开始撰写学位论文。本文介绍了使用LaTeX排版学位论文的方法,特别是针对中国科学院大学研究生学位论文撰写规范指导意见的最新要求。LaTeX以其精确的控制和美观的排版效果成为许多学者的首选。 ... [详细]
  • Nginx 反向代理与负载均衡实验
    本实验旨在通过配置 Nginx 实现反向代理和负载均衡,确保从北京本地代理服务器访问上海的 Web 服务器时,能够依次显示红、黄、绿三种颜色页面以验证负载均衡效果。 ... [详细]
  • 并发编程 12—— 任务取消与关闭 之 shutdownNow 的局限性
    Java并发编程实践目录并发编程01——ThreadLocal并发编程02——ConcurrentHashMap并发编程03——阻塞队列和生产者-消费者模式并发编程04——闭锁Co ... [详细]
  • 本文详细介绍了 GWT 中 PopupPanel 类的 onKeyDownPreview 方法,提供了多个代码示例及应用场景,帮助开发者更好地理解和使用该方法。 ... [详细]
  • Python自动化处理:从Word文档提取内容并生成带水印的PDF
    本文介绍如何利用Python实现从特定网站下载Word文档,去除水印并添加自定义水印,最终将文档转换为PDF格式。该方法适用于批量处理和自动化需求。 ... [详细]
  • 本章将深入探讨移动 UI 设计的核心原则,帮助开发者构建简洁、高效且用户友好的界面。通过学习设计规则和用户体验优化技巧,您将能够创建出既美观又实用的移动应用。 ... [详细]
  • 深入理解Redis的数据结构与对象系统
    本文详细探讨了Redis中的数据结构和对象系统的实现,包括字符串、列表、集合、哈希表和有序集合等五种核心对象类型,以及它们所使用的底层数据结构。通过分析源码和相关文献,帮助读者更好地理解Redis的设计原理。 ... [详细]
  • 本文探讨了2012年4月期间,淘宝在技术架构上的关键数据和发展历程。涵盖了从早期PHP到Java的转型,以及在分布式计算、存储和网络流量管理方面的创新。 ... [详细]
  • 本文将详细介绍如何在没有显示器的情况下,使用Raspberry Pi Imager为树莓派4B安装操作系统,并进行基本配置,包括设置SSH、WiFi连接以及更新软件源。 ... [详细]
  • 本文探讨了如何通过图像处理技术,特别是使用C#中的PictureBox控件,来提取含有数字的特定区域。初步思路包括图像反转等步骤。 ... [详细]
author-avatar
xhl583337984
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有