Search code examples
javasearch-engineinformation-retrieval

Search engine algorithm in Java?


Ok i am really new to this site, i think it has just been 2 hours so it would take a while for me to get used to the site and ask questions that do not go against the guidelines.

All i am trying to do is implement a small search engine, its not homework or work that i am going to get paid for just learning.

The serch engine would have a simple user interface for the user to ask questions and for results to be displayed.

This results would obviously need to be organised it would need to display the number of results it found and the most relevant results would be displayed on top It would also have links to the material it found. I have some expereince in java and therefore i need an algorithm to implement this.

There is a million different search engines some in java some in php and other languages however they have already been implemented and i need to start from scratch implementing this algorithm.

I bought a book just for this purpose its called "Introduction to Algorithms" but that does not help as much as i thougth it would. I need some guides in java, a menu of what i need to do in the form of code.

If anyone could help, i would be very grateful. Thanks


Solution

  • You can use the library Apache Lucene, which is a mature java based information retrieval system.
    You will have to create an IndexWriter, and use it to index your collection of documents.
    Then, you should search for a document, using an IndexSearcher. Please read the documentation, since probably all you need is already built.

    If you want to implement it from scratch, I'd suggest first reading about Information Retrieval. A good source to start with will be Introduction to Information Retrieval