Index Server for Beginners

Submitted on: 1/5/2015 7:29:00 AM
By: Glenn Cook (from psc cd)  
Level: Beginner
User Rating: By 4 Users
Compatibility: ASP (Active Server Pages), VbScript (browser/client side)
Views: 1487
     It's easy to look smart! This tutorial will help you grasp the basics to utilize Index Server in your organization quickly! Read this tutorial, play with some code, put your arms behind your head, lean back in your chair, and watch as others admire your technical handy-work.


Brief Overview of Index Server!

1. Index server is not a bunch of hardcore ASP code that does amazingly fast searches.  It is an incredibly well coded server-side executable that does full-text extraction for creating index files for fast web-based queries. By leveraging the power of Index Server with ASP and HTML, you can easily develop amazing applications.

2. The core of Index Server that you will be most concerned with is made up of two types of files: *.HTX- The template file.  *.IDQ- This file tells Index Server what to do.   It tells Index server what to search, how to organize the data, and what to send to the HTX file.  The HTX file then takes the data and formats it so it's pretty for the user. (In other words, the IDQ file is the playdough and the HTX file is the cookie cutter.)
3. The core of Index server you'll be less concerned with but which does the most work: The Index Server EXECUTABLE- The engine!  The other file(s) is the Index CATALOGUE- Index Server makes an index catalogue that is made up of "keywords" that points to the files you/the administrator have chosen to index. This catalogue is transparently maintained by Index server once you've set everything up.  Basically when it senses that it's got a little downtime, it will start crawling through your designated directories making indexes of keywords.  It updates, adds, and deletes keywords and keeps your indexes up to date...automatically!
4. Currently, Index Server can perform full text exctraction for all of Microsoft's file types- *.doc,*.xls, *.mdb, etc.  Microsoft has also provided a filter interface for third parties to develop filters that will index other file types but these third party filters are often poorly documented and are not supported by the manufacturers. For example, Adobe makes a filter that extracts keywords from PDF files.

Here is the complete process:

You type in a search word or phrase and click "submit" on the asp/htm page.   Your information is passed to the IDQ file which defines the properties that the Index Server executable will use.  This information gets passed to the Index Server engine which crunches the information you want against it's index catalogue. The information Index Server finds is then passed to the HTX file which takes all the information and filters it to make it pretty to deliver you the useful HTML/ASP file you want.....with hyperlinks to the information! Now, you have a page of useful data that you can integrate into any ASP application!

Tools you need!

Assuming you have IIS 3.0 or 4.0 with Index server installed the first logical step is to get your hands dirty by looking at the file types you'll be most concerned with.   The HTM, HTX and IDQ files. (Unless you are an Index Server expert ready to code for the filter interface, leave the other file types to the experts.) Now, download Interdev 6.0!You'll need it for this exercise, and trust me, you'll love it!


Steps to Greatness!

1. First, put a bug in management's ear by suggesting how cool it would be to have full-text searching capabilities on directories containing popular company documents on the company Intranet/Extranet/Internet site.  Watch the Java and Unix coders scramble for an affordable solution.  You see, developers will sell what they know,(I'm no exception), but they will not be able to find a more cost effective quality solution- trust me.  Let them come to the table with their plans of attack and when they are done trying to impress the bosses say, "If you give me an afternoon I'll have a working prototype for you the following morning." 

2. Go right to your IIS server and make sure that Index Server is loaded.  It will automatically create a sample query page which you will edit to suit your needs.  Now check out the "Index Server Administration" shortcut. Make sure that Index server only indexes the directories that YOU want indexed.  If the directory you want indexed is not listed you will have to add a virtual directory in IIS Manager. 

3. Find the physical directory that contains the queryhit.htm page (I think it's in Inetpub/samples/search/ but I'll have to check tomorrow.)  Open up the queryhit.htm, queryhit.htx, and queryhit.idq files that are used in the Index Server example query using your Interdev 6.0 and look at the code.  ****IMPORTANT NOTE: Never, ever, open and save any of these files with FrontPage.   Unfortunately, FrontPage has a tendency to think that it a smarter coder than we are and will totally destroy the working code. What you should use to view all your ASP code is Microsoft's Visual Interdev 6.0!  **** Although my first inclination is to suggest start playing with the code, let me recommend looking at the code while you play with the sample queries to understand how it's working.

4. You'll notice that queryhit.htm does a simple "GET" submission to the queryhit.idq file based on the text the user has input.  If you look at the IDQ file you'll see a bunch of code you're not familiar with.  What is this crap?   Well, it's the stuff that the Index Server executable understands ie. <%CiTotalNumberPages%>.  Since this is not "" I'm not going to go into editing all of these properties.  Honestly, you can get away with using the default code that Microsoft offers in it's samples.  If you want some good resources to learn more about these properties check out Microsoft's siteor buy a book (Wrox's Professional Active Server Pages.)!

5.  One of the long awaited Interdev 6.0 features is a WYSIWYG editor that doesn't screw up the code like FrontPage.  Use Interdev to look at your HTX file.  This is the file that formats the results Index Server returns and is the best place to really learn how Index server works.  You'll notice that it has a healthy mixture of several types of code:  Index server properties, HTML and ASP.  You'll also notice that Microsoft does a pretty good job of documenting what the code is doing.

6. Make a backup of the queryhit.htx file.  Now go back to your WYSIWYG editor and start making changes that suit your needs. Throw in your company logo. Delete output that you don't need! Add, edit or delete text as you see fit.  It's surprisingly easy!

7. Test your changes and go show off!

The reason why I wrote this tutorial is because when I first played with Index Server I couldn't believe how easy it was.  Within a week after I accomplished this nominal feat at one company, through word-of-mouth, another company was calling me to do the same thing for them.  I told them that it was so easy they could do it themselves but they would hear nothing of it.  They wanted ME?!  No, they wanted this knowledge!   You don't have to be smart in this industry, you just have to have the knowledge people are willing to pay for. Well, maybe you can define intelligence by knowing what knowledge people are willing to pay for.  In that case, by reading this, your IQ just went up about $50 an hour.

Other 7 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.