热门标签 | 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/

自定义搜索引擎



推荐阅读
  • Nginx使用(server参数配置)
    本文介绍了Nginx的使用,重点讲解了server参数配置,包括端口号、主机名、根目录等内容。同时,还介绍了Nginx的反向代理功能。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • javascript  – 概述在Firefox上无法正常工作
    我试图提出一些自定义大纲,以达到一些Web可访问性建议.但我不能用Firefox制作.这就是它在Chrome上的外观:而那个图标实际上是一个锚点.在Firefox上,它只概述了整个 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 本文介绍了Perl的测试框架Test::Base,它是一个数据驱动的测试框架,可以自动进行单元测试,省去手工编写测试程序的麻烦。与Test::More完全兼容,使用方法简单。以plural函数为例,展示了Test::Base的使用方法。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • 本文介绍了为什么要使用多进程处理TCP服务端,多进程的好处包括可靠性高和处理大量数据时速度快。然而,多进程不能共享进程空间,因此有一些变量不能共享。文章还提供了使用多进程实现TCP服务端的代码,并对代码进行了详细注释。 ... [详细]
  • 计算机存储系统的层次结构及其优势
    本文介绍了计算机存储系统的层次结构,包括高速缓存、主存储器和辅助存储器三个层次。通过分层存储数据可以提高程序的执行效率。计算机存储系统的层次结构将各种不同存储容量、存取速度和价格的存储器有机组合成整体,形成可寻址存储空间比主存储器空间大得多的存储整体。由于辅助存储器容量大、价格低,使得整体存储系统的平均价格降低。同时,高速缓存的存取速度可以和CPU的工作速度相匹配,进一步提高程序执行效率。 ... [详细]
  • 拥抱Android Design Support Library新变化(导航视图、悬浮ActionBar)
    转载请注明明桑AndroidAndroid5.0Loollipop作为Android最重要的版本之一,为我们带来了全新的界面风格和设计语言。看起来很受欢迎࿰ ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • 本文介绍了在处理不规则数据时如何使用Python自动提取文本中的时间日期,包括使用dateutil.parser模块统一日期字符串格式和使用datefinder模块提取日期。同时,还介绍了一段使用正则表达式的代码,可以支持中文日期和一些特殊的时间识别,例如'2012年12月12日'、'3小时前'、'在2012/12/13哈哈'等。 ... [详细]
  • 本文介绍了Oracle存储过程的基本语法和写法示例,同时还介绍了已命名的系统异常的产生原因。 ... [详细]
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社区 版权所有