javascript 实现搜索静态页面的站点搜索引擎

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7082293/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 22:54:39  来源:igfitidea点击:

Implementing a site search engine that searches static pages

phpjavascriptsearchsearch-engine

提问by Camrin Parnell

What I would like to accomplish is to integrate a search feature into my website that is capable of searching my web pages that are static(content does not change). I need the search engine to be free to use and must operate using JavaScript or PHP (and MySQL if needed). I have tried looking on Google (if anyone is wondering) , but maybe I'm just not searching for the right thing. If anyone could point me in the right direction I would greatly appreciate it.

我想要完成的是将搜索功能集成到我的网站中,该功能能够搜索我的静态网页(内容不会改变)。我需要搜索引擎可以免费使用,并且必须使用 JavaScript 或 PHP(如果需要,还可以使用 MySQL)进行操作。我试过在谷歌上搜索(如果有人想知道的话),但也许我只是没有在寻找正确的东西。如果有人能指出我正确的方向,我将不胜感激。

Thanks

谢谢

回答by Diodeus - James MacFarlane

Why reinvent the wheel - use Google Custom Search: http://www.google.com/cse/

为什么要重新发明轮子 - 使用 Google 自定义搜索:http: //www.google.com/cse/

回答by internals-in

i got something today , so updating for other users

Google Internal Site Search script (JavaScript, free)Need a powerful internal search engine script to allow visitors to search the contents of your site? This script uses Google to enable comprehensive search on your site. Cut and paste installation that works on any type of sites.

Google 内部站点搜索脚本(JavaScript,免费)需要一个强大的内部搜索引擎脚本来允许访问者搜索您站点的内容吗?此脚本使用 Google 在您的网站上启用全面搜索。剪切和粘贴适用于任何类型网站的安装。

Sphider (PHP, free)Sphider is a lightweight web spider and search engine written in PHP, using MySQL as its back end database. It is suitable for adding search functionality to small or medium sites (up to around 20,000 pages). It also works great as a tool for site analysis - finding broken links, gathering statistics about the site etc.

Spider(PHP,免费)Spider 是一个用 PHP 编写的轻量级网络蜘蛛和搜索引擎,使用 MySQL 作为其后端数据库。它适用于向中小型网站(最多约 20,000 页)添加搜索功能。它还可以很好地用作站点分析工具 - 查找损坏的链接,收集有关站点的统计信息等。

TSEP (PHP, free)TSEP is a search engine for a website for your website! You can put a "Search this site" anywhere on your website and let people quickly find what they are looking for.

TSEP(PHP,免费)TSEP 是您网站的网站搜索引擎!您可以在网站的任何位置放置“搜索此站点”,让人们快速找到他们要查找的内容。

Zoom Search Engine (PHP, commercial $49-$99)Zoom is a robust PHP script for adding powerful custom search engine to your website, intranet, or CD/DVD.

Zoom 搜索引擎(PHP,商业 $49-$99)Zoom 是一个强大的 PHP 脚本,用于将强大的自定义搜索引擎添加到您的网站、内部网或 CD/DVD。

Perlfect Search (Perl, free)An integrated, general purpose, site indexer and search engine. It comes as a pair of distinct scripts. The indexer, that automatically, scans and indexes a web site, and the search engine, a cgi script that serves search queries for keywords over the index, and displays results pages in html, in a standard format including title, description and relevance ranking for each matching document.

Perlfect Search(Perl,免费)一个集成的通用站点索引器和搜索引擎。它是一对不同的脚本。自动扫描和索引网站的索引器,以及搜索引擎,一个 cgi 脚本,通过索引为关键字提供搜索查询,并以 html 格式显示结果页面,标准格式包括标题、描述和相关性排名每个匹配的文档。

CGIWorld Site Search (Perl, commercial $25)SiteSearch gives you the ability to search your website quickly & easily by the use of the password protected browser based administration area. Set the path of the directory you want searched, set the files & directories you want searched, and also the directories & files you do not want searched. SiteSearch is a great tool for the average website of around or below 500 pages.

CGIWorld Site Search(Perl,商业 25 美元)SiteSearch 使您能够通过使用受密码保护的基于浏览器的管理区域快速轻松地搜索您的网站。设置您要搜索的目录的路径,设置您要搜索的文件和目录,以及您不想搜索的目录和文件。SiteSearch 是一个很好的工具,适用于大约或低于 500 页的平均网站。

Fluid Dynamics Search Engine (Perl, free and commercial versions)FDSE is an easy-to-install search engine for local and remote sites. It returns fast, accurate results from a template-driven architecture. Freeware and shareware versions are available with Perl source.

流体动力学搜索引擎(Perl,免费和商业版本)FDSE 是一个易于安装的本地和远程站点搜索引擎。它从模板驱动的架构中快速、准确地返回结果。Perl 源代码提供免费软件和共享软件版本。

ASP Site Search (ASP, free)This ASP Site Search application is commented on each line of code to make it easier for a beginner to follow or to customise. The Site Search application comes in two versions the Advanced version has more functions but requires that the web server has the VB Scripting Engine 5 or above installed.

ASP 站点搜索(ASP,免费)该 ASP 站点搜索应用程序在每一行代码上都进行了注释,以便初学者更容易遵循或自定义。Site Search 应用程序有两个版本,高级版本功能更多,但需要 Web 服务器安装 VB Scripting Engine 5 或更高版本。

Site Search Pro (ASP, commercial)Site Search Pro 2.0 is comprehensive search script for ASP or PHP site

Site Search Pro (ASP, Commercial)Site Search Pro 2.0 是针对 ASP 或 PHP 站点的综合搜索脚本

Refer : http://www.javascriptkit.com/howto/search2.shtml

参考:http: //www.javascriptkit.com/howto/search2.shtml

回答by Mitali Cyrus

You might want to look at this. (For anyone who struggles their way through this problem)

你可能想看看这个。(对于任何努力解决这个问题的人)

JSE internal seach engine

JSE 内部搜索引擎

http://www.javascriptkit.com/script/script2/jse/

http://www.javascriptkit.com/script/script2/jse/

Uses regular expressions to efficiently and rapidly search the index for matches based on the entered keywords. Supports basic logic (ie: negation).

使用正则表达式根据输入的关键字高效快速地搜索索引以查找匹配项。支持基本逻辑(即:否定)。

Returns the results on a seperate page from the search form itself, neatly formatted. Uses session cookies to transmit the query between the two pages.

在与搜索表单本身不同的页面上返回结果,格式整齐。使用会话 cookie 在两个页面之间传输查询。

Stores the index (url, keywords and description for each page you wish to be "crawled") in the "results" page. This means the index is loaded only when a search has actually been performed, saving on bandwidth and download time.

在“结果”页面中存储索引(您希望被“抓取”的每个页面的 URL、关键字和描述)。这意味着仅在实际执行搜索时才加载索引,从而节省带宽和下载时间。

Searches title, description and desingated keywords within the index for a match.

在索引中搜索匹配项的标题、描述和指定关键字。

回答by Bracke

A bit late, anyway I would suggest Tipue-search. Its pure javascript and can be integrated with any page.

有点晚了,无论如何我建议Tipue-search。它是纯 javascript,可以与任何页面集成。

https://github.com/Tipue/Tipue-Search

https://github.com/Tipue/Tipue-Search

回答by A Jolly Geek

"Sphider is a lightweight web spider and search engine written in PHP, using MySQL as its back end database. It is a great tool for adding search functionality to your web site or building your custom search engine. Sphider is small, easy to set up and modify, and is used in thousands of websites across the world."

"Sphider 是用 PHP 编写的轻量级网络蜘蛛和搜索引擎,使用 MySQL 作为其后端数据库。它是为您的网站添加搜索功能或构建自定义搜索引擎的绝佳工具。Sphider 体积小,易于设置和修改,并在全球数千个网站中使用。”

http://www.sphider.eu/

http://www.spider.eu/

回答by Treffynnon

Swiftype is another more recent addition to the market too: https://swiftype.com/

Swiftype 也是市场上的另一个新成员:https://swiftype.com/