Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a web search engine [closed]

I've always been interested in developing a web search engine. What's a good place to start? I've heard of Lucene, but I'm not a big Java guy. Any other good resources or open source projects?

I understand it's a huge under-taking, but that's part of the appeal. I'm not looking to create the next Google, just something I can use to search a sub-set of sites that I might be interested in.

like image 268
Aseem Avatar asked Sep 21 '08 21:09

Aseem


People also ask

Can I build my own search engine?

To create a new Programmable Search Engine, all you have to do is choose which sites to search and give your search engine a name. From the Programmable Search Engine homepage, click Create a custom search engine or New search engine.

How much does it cost to build a search engine?

If you want to build a search engine like Google (with a decent search quality), we would say it might cost you about $100M (for the prototype) – including costs for servers, bandwidth, colocation, electricity and so on. Maintenance costs for the existing cluster may go up to $25M per year.

Is there a non biased search engine?

Anonymous search engines like DuckDuckGo and Startpage do not collect users' personal information. Since they don't know anything about you, anonymous search engines eliminate the possibility of location or search history bias.


2 Answers

There are several parts to a search engine. Broadly speaking, in a hopelessly general manner (folks, feel free to edit if you feel you can add better descriptions, links, etc):

  1. The crawler. This is the part that goes through the web, grabs the pages, and stores information about them into some central data store. In addition to the text itself, you will want things like the time you accessed it, etc. The crawler needs to be smart enough to know how often to hit certain domains, to obey the robots.txt convention, etc.

  2. The parser. This reads the data fetched by the crawler, parses it, saves whatever metadata it needs to, throws away junk, and possibly makes suggestions to the crawler on what to fetch next time around.

  3. The indexer. Reads the stuff the parser parsed, and creates inverted indexes into the terms found on the webpages. It can be as smart as you want it to be -- apply NLP techniques to make indexes of concepts, cross-link things, throw in synonyms, etc.

  4. The ranking engine. Given a few thousand URLs matching "apple", how do you decide which result is the best? Jut the index doesn't give you that information. You need to analyze the text, the linking structure, and whatever other pieces you want to look at, and create some scores. This may be done completely on the fly (that's really hard), or based on some pre-computed notions of "experts" (see PageRank, etc).

  5. The front end. Something needs to receive user queries, hit the central engine, and respond; this something needs to be smart about caching results, possibly mixing in results from other sources, etc. It has its own set of problems.

My advice -- choose which of these interests you the most, download Lucene or Xapian or any other open source project out there, pull out the bit that does one of the above tasks, and try to replace it. Hopefully, with something better :-).

Some links that may prove useful: "Agile web-crawler", a paper from Estonia (in English) Sphinx Search engine, an indexing and search api. Designed for large DBs, but modular and open-ended. "Information Retrieval, a textbook about IR from Manning et al. Good overview of how the indexes are built, various issues that come up, as well as some discussion of crawling, etc. Free online version (for now)!

like image 117
3 revs Avatar answered Oct 13 '22 22:10

3 revs


Xapian is another option for you. I've heard it scales better than some implementations of Lucene.

like image 23
Oli Avatar answered Oct 13 '22 23:10

Oli