i have to create a mini search engine given a directory of 50 documents and a set of sample queries. i need to include the documents in a hash table and search through the documents for the keywords in the queries.. i have no idea where to start... can anyone help me

Have you done any research on Search Engines and how they are structured?

Do you understand the benefits of using a HashTable for this assignment?

I guess a good start would be to create a class for Documents. You can seperate the document into information such as Head info, body info and tail info, or just info if none of these attributes matter for the scope of your assignment.

You can map expected words to a Document reference, and if two documents have a similar search-key, then you can have it such that one key references two Documents (or more than two if more than one document contains a particular key).

The easy way of doing this is by using a Map with query-input as keys and a linked list (or vector, or some other suitable collection type) of documents as values.

You're going to need a lot of space to do this because you have to compute the total possible amount of permutations of words that can occur from all of the documents combined. Then again if the necessary queries are limited then this can be avoided (somewhat).

I'm assuming the assignment doesn't request you to do that much, but consider the possibilities and the necessary data structures to enable easier searching.

In any case, your best bet is just to wiki Search Engines and google the motivation behind search engines and successful data structures used to enable fast look-up.

This article has been dead for over six months. Start a new discussion instead.