Creating an ASP.NET Search Engine

Introduction

When I was working on an ASP.NET project, I had to add the site search module - this article demonstrates how. This search engine will index an entire page for matching keyword(s) or a phrase and will count how many times the keyword(s) or phrase are found on the page, and displays the results with the highest matches first.

The Search Engine module will search an entire page also dynamic pages for matching keyword(s) or a phrase and will count how many times the keyword(s) or phrase are found on the page, and display the results with the highest matches first. The module will search all files with the extensions that you can easily place the extension name into the web.config file where indicated. Files or folders that you don't want searched can be placed in the web.config where indicated, so these files and folders are not searched. Also now you can choose the encoding of your choice.

This updated article contains tips to globalize and enhance the code.

Note: It is best suited for small sites. Also you can modify this code to crawl pages internally by using regular expressions. For larger site you will need to write to XML file once periodically and then read from XML file. I have offered tips at the end of the section to do so.

You might also like...

Comments

About the author

Stevan Rodrigues United States

I am a Microsoft Certified Solutions Developer in .Net Architecture (MCSD.Net Early Achiever – one among the first 2500 worldwide), Microsoft Certified Application Developer in .Net – MCAD.Net (...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Java is to JavaScript what Car is to Carpet.” - Chris Heilmann