是否有可能使用Erlang、Mnesia&;雅司病?

是否有可能使用Erlang、Mnesia&;雅司病?,erlang,search-engine,web-crawler,mnesia,yaws,Erlang,Search Engine,Web Crawler,Mnesia,Yaws,我正在考虑使用Erlang、Mnesia和Yaws开发一个web搜索引擎。有没有可能使用这些软件来创建一个功能强大、速度最快的web搜索引擎?它需要什么来完成这一点,我该如何开始 据我所知,谷歌的自然语言处理搜索引擎是使用erlang开发的 您是否考虑过(它也是用erlang编写的)作为一种可能的工具来帮助您解决一些问题 在中,有一个波特词干算法的实现。它从未集成到“rdbms”中,所以它基本上只是放在那里。我们已经在内部使用了它,并且它运行得非常好,至少对于不是很大的数据集(我还没有在巨大的数

我正在考虑使用Erlang、Mnesia和Yaws开发一个web搜索引擎。有没有可能使用这些软件来创建一个功能强大、速度最快的web搜索引擎?它需要什么来完成这一点,我该如何开始

据我所知,谷歌的自然语言处理搜索引擎是使用erlang开发的

您是否考虑过(它也是用erlang编写的)作为一种可能的工具来帮助您解决一些问题

在中,有一个波特词干算法的实现。它从未集成到“rdbms”中,所以它基本上只是放在那里。我们已经在内部使用了它,并且它运行得非常好,至少对于不是很大的数据集(我还没有在巨大的数据量上测试过它)

相关模块包括:

rdbms_wsearch.erl
rdbms_wsearch_idx.erl
rdbms_wsearch_porter.erl
当然,还有一个问题


我不能说你是否能制造出最快的引擎。更快的搜索引擎有市场吗?我从来没有遇到过像谷歌这样的速度问题。但是一个能增加我找到问题好答案机会的搜索工具会让我感兴趣。

我推荐CouchDB而不是Mnesia

  • Mnesia没有Map Reduce,CouchDB有(更正-参见注释)
  • Mnesia是静态类型的,CouchDB是一个文档数据库(页面是文档,在我看来更适合信息模型)
雅司病很好。你也应该考虑MochiWeb。


使用Erlang不会出错

Erlang可以成为当今最强大的网络爬虫程序。让我带你通过我的简单爬虫

第一步。我创建了一个简单的并行模块,我称之为mapreduce

因此,您可以生成许多进程。执行该命令时,请记住转义URL以及输出文件路径。另一方面,有一个进程的工作是监视下载页面的目录。它读取并解析这些页面,然后可以在解析后删除或保存到其他位置,或者更好地使用
zip模块将其存档
folder_check()->
    spawn(fun() -> check_and_report() end),
    ok.

-define(CHECK_INTERVAL,5).

check_and_report()->
    %% avoid using
    %% filelib:list_dir/1
    %% if files are many, memory !!!
    case os:cmd("ls | wc -l") of
        "0\n" -> ok;
        "0" -> ok;
        _ -> ?MODULE:new_files_found()
    end,
    sleep(timer:seconds(?CHECK_INTERVAL)),
    %% keep checking
    check_and_report().

new_files_found()->
    %% inform our parser to pick files
    %% once it parses a file, it has to 
    %% delete it or save it some
    %% where else
    gen_server:cast(?MODULE,files_detected).

3> 蜘蛛机器人:解析url(“http://facebook.com"). [{“说明”, “facebook是一种社交工具,它将人们与朋友以及在他们周围工作、学习和生活的其他人联系起来。人们使用facebook与朋友保持联系,上传无限数量的照片,发布链接 和视频,了解更多关于他们遇到的人的信息, {“机器人”,“noodp,noydir”}, [],[],[],[]], {标题,“不兼容的浏览器| facebook”}]
4> 蜘蛛机器人:解析url(“http://python.org"). [{“说明”, “python主页,一种解释性的、交互式的、面向对象的、可扩展的编程语言。它提供了清晰性和多功能性的非凡结合,并且是免费的和可扩展的。” 全面移植,, {“关键字”, “python编程语言面向对象web免费源代码”}, []], {标题,“python编程语言-官方网站”}]
5> 蜘蛛机器人:解析url(“http://www.house.gov/"). [[[],[],[], {“说明”, “美国众议院主页”}, {“说明”, “美国众议院主页”}, [],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], [],[],[]|...], {标题,“美国众议院第111届国会第二届会议”}]


您现在可以意识到,我们可以根据页面的关键字对页面进行索引,并提供一个良好的页面修改时间表。另一个挑战是如何制作一个爬虫(可以在整个网络上移动,从一个域到另一个域),但这很容易。这可以通过解析href标记的Html文件来实现。让HTML解析器提取所有href标记,然后您可能需要一些正则表达式来获取给定域下的链接。

运行爬虫程序 7> 星形连接器:连接器2(“http://erlang.org"). 链接:[”http://www.erlang.org/index.html", "http://www.erlang.org/rss.xml", "http://erlang.org/index.html","http://erlang.org/about.html", "http://erlang.org/download.html", "http://erlang.org/links.html","http://erlang.org/faq.html", "http://erlang.org/eep.html", "http://erlang.org/starting.html", "http://erlang.org/doc.html", "http://erlang.org/examples.html", "http://erlang.org/user.html", "http://erlang.org/mirrors.html", "http://www.pragprog.com/titles/jaerlang/programming-erlang", "http://oreilly.com/catalog/9780596518189", "http://erlang.org/download.html", "http://www.erlang-factory.com/conference/ErlangUserConference2010/speakers", "http://erlang.org/download/otp_src_R14B.readme", "http://erlang.org/download.html", "https://www.erlang-factory.com/conference/ErlangUserConference2010/register", "http://www.erlang-factory.com/conference/ErlangUserConference2010/submit_talk", "http://www.erlang.org/workshop/2010/", "http://erlangcamp.com","http://manning.com/logan", "http://erlangcamp.com","http://twitter.com/erlangcamp", "http://www.erlang-factory.com/conference/London2010/speakers/joearmstrong/", "http://www.erlang-factory.com/conference/London2010/speakers/RobertVirding/", "http://www.erlang-factory.com/conference/London2010/speakers/MartinOdersky/", "http://www.erlang-factory.com/", "http://erlang.org/download/otp_src_R14A.readme", "http://erlang.org/download.html", "http://www.erlang-factory.com/conference/London2010", "http://github.com/erlang/otp", “ht Command: curl "http://www.erlang.org" -o "/downloaded_sites/erlang/file1.html"
In Erlang
os:cmd("curl \"http://www.erlang.org\" -o \"/downloaded_sites/erlang/file1.html\""). folder_check()-> spawn(fun() -> check_and_report() end), ok. -define(CHECK_INTERVAL,5). check_and_report()-> %% avoid using %% filelib:list_dir/1 %% if files are many, memory !!! case os:cmd("ls | wc -l") of "0\n" -> ok; "0" -> ok; _ -> ?MODULE:new_files_found() end, sleep(timer:seconds(?CHECK_INTERVAL)), %% keep checking check_and_report(). new_files_found()-> %% inform our parser to pick files %% once it parses a file, it has to %% delete it or save it some %% where else gen_server:cast(?MODULE,files_detected). 2> spider_bot:parse_url("http://erlang.org"). [[[],[], {"keywords", "erlang, functional, programming, fault-tolerant, distributed, multi-platform, portable, software, multi-core, smp, concurrency "}, {"description","open-source erlang official website"}], {title,"erlang programming language, official website"}] 3> spider_bot:parse_url("http://facebook.com"). [[{"description", " facebook is a social utility that connects people with friends and others who work, study and live around them. people use facebook to keep up with friends, upload an unlimited number of photos, post links and videos, and learn more about the people they meet."}, {"robots","noodp,noydir"}, [],[],[],[]], {title,"incompatible browser | facebook"}] 4> spider_bot:parse_url("http://python.org"). [[{"description", " home page for python, an interpreted, interactive, object-oriented, extensible\n programming language. it provides an extraordinary combination of clarity and\n versatility, and is free and comprehensively ported."}, {"keywords", "python programming language object oriented web free source"}, []], {title,"python programming language – official website"}] 5> spider_bot:parse_url("http://www.house.gov/"). [[[],[],[], {"description", "home page of the united states house of representatives"}, {"description", "home page of the united states house of representatives"}, [],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], [],[],[]|...], {title,"united states house of representatives, 111th congress, 2nd session"}] 7> spider_connect:conn2("http://erlang.org"). Links: ["http://www.erlang.org/index.html", "http://www.erlang.org/rss.xml", "http://erlang.org/index.html","http://erlang.org/about.html", "http://erlang.org/download.html", "http://erlang.org/links.html","http://erlang.org/faq.html", "http://erlang.org/eep.html", "http://erlang.org/starting.html", "http://erlang.org/doc.html", "http://erlang.org/examples.html", "http://erlang.org/user.html", "http://erlang.org/mirrors.html", "http://www.pragprog.com/titles/jaerlang/programming-erlang", "http://oreilly.com/catalog/9780596518189", "http://erlang.org/download.html", "http://www.erlang-factory.com/conference/ErlangUserConference2010/speakers", "http://erlang.org/download/otp_src_R14B.readme", "http://erlang.org/download.html", "https://www.erlang-factory.com/conference/ErlangUserConference2010/register", "http://www.erlang-factory.com/conference/ErlangUserConference2010/submit_talk", "http://www.erlang.org/workshop/2010/", "http://erlangcamp.com","http://manning.com/logan", "http://erlangcamp.com","http://twitter.com/erlangcamp", "http://www.erlang-factory.com/conference/London2010/speakers/joearmstrong/", "http://www.erlang-factory.com/conference/London2010/speakers/RobertVirding/", "http://www.erlang-factory.com/conference/London2010/speakers/MartinOdersky/", "http://www.erlang-factory.com/", "http://erlang.org/download/otp_src_R14A.readme", "http://erlang.org/download.html", "http://www.erlang-factory.com/conference/London2010", "http://github.com/erlang/otp", "http://erlang.org/download.html", "http://erlang.org/doc/man/erl_nif.html", "http://github.com/erlang/otp", "http://erlang.org/download.html", "http://www.erlang-factory.com/conference/ErlangUserConference2009", "http://erlang.org/doc/efficiency_guide/drivers.html", "http://erlang.org/download.html", "http://erlang.org/workshop/2009/index.html", "http://groups.google.com/group/erlang-programming", "http://www.erlang.org/eeps/eep-0010.html", "http://erlang.org/download/otp_src_R13B.readme", "http://erlang.org/download.html", "http://oreilly.com/catalog/9780596518189", "http://www.erlang-factory.com", "http://www.manning.com/logan", "http://www.erlang.se/euc/08/index.html", "http://erlang.org/download/otp_src_R12B-5.readme", "http://erlang.org/download.html", "http://erlang.org/workshop/2008/index.html", "http://www.erlang-exchange.com", "http://erlang.org/doc/highlights.html", "http://www.erlang.se/euc/07/", "http://www.erlang.se/workshop/2007/", "http://erlang.org/eep.html", "http://erlang.org/download/otp_src_R11B-5.readme", "http://pragmaticprogrammer.com/titles/jaerlang/index.html", "http://erlang.org/project/test_server", "http://erlang.org/download-stats/", "http://erlang.org/user.html#smtp_client-1.0", "http://erlang.org/user.html#xmlrpc-1.13", "http://erlang.org/EPLICENSE", "http://erlang.org/project/megaco/", "http://www.erlang-consulting.com/training_fs.html", "http://erlang.org/old_news.html"] ok