Click here to Skip to main content
15,881,413 members
Articles / Web Development / ASP.NET

Using the Indexing Server in ASP.NET

Rate me:
Please Sign up or sign in to vote.
1.44/5 (3 votes)
30 Oct 2007CPOL2 min read 17K   113   10   1
An introduction to using the Indexing Server in ASP.NET.

Introduction

A lot of websites provide search capabilities, where you can simply type several words, press the "Search" button, and you'll receive a list of pages which contains these words. It's simple. But, how can you implement these features in your own web application? Yes, you have to use Indexing Service, which will index your files or web pages. After that, you can use full text search features.

There are a lot of solutions which allow you to provide this functionality in your application. One of them is Microsoft Indexing Service. It's part of Windows 2000 and later Windows versions. So, if you provide only Windows solutions (ASP.NET web application, Windows Forms application, etc.), you can use this Microsoft product.

On of the biggest advantages of Indexing Service is that it's totally free. You can use it without any restrictions or additional licenses. I think that this is a big deal, because other indexing products cost a lot of money. If you are developing small or medium level projects, you don't want to pay thousands of dollars for a full text search tool.

If you choose Indexing Service, you should remember that it can only index a file system. For example, you can't use it for indexing files which are stored in your database. This is a big minus of Microsoft Indexing Service, but I believe that you can solve this limitation.

Using the code

C#
sCatelogName = "Hps";
sSql = "Select DocTitle,Filename,Size,PATH,URL from HPS0135.System..SCOPE()" + 
       " where FREETEXT('" + TextBox1.Text + "')";
sSql = "Select DocTitle,Filename,Size,PATH,URL from SCOPE() " + 
       "where FREETEXT('" + TextBox1.Text + "')";
sProvider = "Provider=MSIDXS.1;Data Source='" + sCatelogName + "'";
sCon = new OleDbConnection(sProvider);
sAdap = new OleDbDataAdapter(sSql, sCon);

Summary

Microsoft Indexing Service is totally free and is a powerful product included with Windows 2000 or later Windows versions. It's very simple to use. You can easily create indexes. You can also query these indexes using an OLEDB data provider. If you are working with Microsoft .NET, it is very easy to use it. I recommend you see the included example. This example will show you how to use the full text search features. I hope that this article will help you to start using Indexing Service.

When I prepared this article, I referred to these materials:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralPlugins Pin
Rafael Nicoletti30-Oct-07 5:09
Rafael Nicoletti30-Oct-07 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.