Depends what you want to search I would think. If you just want to search pages on a single site then it would be easy enough. If you want to search all pages on the web then it's a lot of work.
The more things you want to search the more complex the search engine will need to be and the more storage and processing power you will likely need.
Google and Yahoo both let you build your own custom search engine based on their search engines. You just tell them the sites you want to search and they do the work.
__________________ l Search Engine Friendly Web Design | Please login or register to view this content. Registration is FREE
l Tips On Marketing, SEO, Design, and Development | Please login or register to view this content. Registration is FREE
Having done the former of vangogh's suggestions, it's not hard. It's just a basic search query and then a sorting algorithm for the most part. On a single site with controlled content, it's pretty easy. Just look for repetition and prominence of keywords, away you go.
Now, to do a big G or a Yahoo! or MSN sort of deal...there's a reason there are only three major search engines.