[Tutor] writing a search engine

Mathias Mamsch Zabelkind@web.de
Tue Jul 1 12:20:02 2003


> Any suggestions on where to start?  I plan on writing one for a small
> site of mine.  It will basically be "google-style"- simple and
> functional.  The item being searched will be text files, where users can
> search based on title, contents, or both.  I was reading through some
> books but I'm stumped on where to begin.  I've never tried writing
> something even similar to a search engine and I guess I'm little
> confused/overwhelmed/bewildered.  :)  You guys always come to the rescue
> for me, so how about one more time?
> --
> Kyle
>

So the problem is you cannot search all your documents, after the user
entered the text. Its clear that you have to do some "hashing", that means
search the documents offline and create a list of keywords and their
corresponding references.

An easy example would be, to store every word, which appears in your
documents as a key in a dictionary and the value could be the file the word
appeared in and the position of the word in the file. So when you get a
search query from the user, you search your list and have all occurences of
the word.
Modern search engines like google use complex algorithms for hashing the
keywords in the documents, that is why they are so fast.

Greetings Mathias Mamsch