[Home] [Search Articles] [Index Server Info] [In the News] [Future Use] [Microsoft & XML]

Microsoft Index Server

The following summary is adapted from Professional Active Server Pages 2.0 pp. 671-700, Wrox Press, 1998.

Overview

Microsoft Index Server (running on IIS) allows your web site content to be available to web searches. There are different approaches to developing queries for Index Server.

One is Active Server Pages (ASP) searching using Query and Utility Objects which are scripting objects designed for Index Server Searching. The objects return an ActiveX Data Object (ADO) Recordset which returns fields like a record returned from a database table. The other approach uses the ADO searching where SQL statements are used rather than the Query and the Utility objects. Index Server can be viewed as a database catalog that can process queries like any other database.

How Index ServerWorks

Once installed (it’s part of the NT Options pack) Index Server is almost self-maintaining. During times of system inactivity, it builds an maintains catalogs of the documents stored on the site. When a search is performed it uses the contents of the index to perform then search and builds and returns a html results page to the client.

Using Catalogs

A catalog is a collection of directories that make up a unit within the Index Server Search. Queries specify which catalog they want to search. If no catalog is specified the default is used, generally the Inetpub\wwwroot directory.

To add or delete catalogs from Index Server use Index Server Manager. This is an add-in for the Microsoft Management Console application and is installed with Index Server.

Using Scope

Scope encompasses one or more tables in a database. A catalog can consist of one or many directories. It is not very efficient to search all the directories in a catalog. This is where scope comes into play. The scope defines which group of subdirectories should be included in the search.

The Types of Information Index Server Stores

Index server stores many document details: document properties such as creation date, time, updated, size, and an abstract of the documents contents.

This allows searching for a word, group of words, specifying the type of file and other properties. The language engine can match words literally where a search for catch* would included catcher and catching. The engine can also match grammatically where a search for catch** would include catching and caught. The double asterisk specifies to the engine so search for all grammatical variations of catch. Index server also includes a noise list file. This is an editable file that prevents words such as and, or the etc. from being included in the index.

The Types of Documents that Can be Cataloged


Index server will catalog all documents stored in the virtual paths in Internet Information Server (IIS).  These can be HTML files, text files, and Microsoft Office documents.  Index Server has an filter interface so third party vendors can provide the logic to enable it to support other application file formats.

Index Server Query Language

Words separated by space or ordinary punctuation are treated as a phrase, and words in the noise list are ignored.  Matching is case insensitive.  Normal wildcard characters and Boolean operators such as AND, OR, NEAR, AND NOT can be used along with their shorthand characters &, | , &! .  Searches can also be performed for file properties such as Filename, Size, DocAuthor (document author).

Index Server Query Language

It is also possible to perform queries using ADO directly as mentioned in the introduction earlier. This topic will not be covered in detail here since this project used asp to perform the queries. However more information on this topic is available from the Microsoft examples included with Index Server and various other publishers such as Wrox Press’ book, Professional Active Server Pages.

Query and Utility Objects

By using Query and Utility objects queries can be defined and executed using ASP code. Instead of piping the results of the query directly back to the client the contents are stored in a Recordset that can be manipulated with script. The Utility object support methods that enables programmers to perform various tasks with the query objects. The most important of these tasks involves define the query’s scope.

The query object

The query object encapsulates an Index Server search. To create a query object use the Server object’s CreateObject method to create and store a reference the object, e.g. Set objquery = Server.CreateObject("ixsso.Query")

 

Query Objects Methods

Method

Description

CreateRecordset

Executes the query stored in the Query property and returns the results as an ADO Recordset.

DefineColumn

Associates a new name with a column.

QuerytoURL

Builds a URL out of the Query objects state.

Reset

Clears the setting of the Query object.

SetQueryFromURL

Initializes the Query property from the contents of a URL.

 

Query object Properties

Property

Description

AllowEnumeration

Allows the query to use enumeration (as opposed to an index).

Catalog

A string that specifies the name of the catalog to search.

Columns

A string that contains a command delimited list of the columns to return in the Recordset.

LocaleID

Specifies the query’s locale.

MaxRecords

Specifies the maximum number of records to return.

Query

A string that contains the query to execute. This string consists of some combination of Index Server query language properties and operators.  Functionally analogous to the where clause.

SortBy

A comma delimited string that specifies the columns on which the search results should be sorted.

OptimizeFor

Allows you to set performance priorities on the query.

 

Setting the Query Properties Using a Form

The following are example from Professional Active Server Pages 2.0 from Wrox Press. The examples are also available on their web site www.wrox.com .

Using the Query object SetQueryFromURL method allows you to initialize the Query object. To use this technique the form field names must follow some conventions.

The fields that contains the query text must be called qu. The field that identifies the catalog to search should be named ct. When the form is posted to an asp page and then the call to the SetQueryFromURL method, this method maps the contents of the qu form field to the Query objects query property. The contents of the ct form filed are mapped to the objects Catalog property.

Input fields in the form : <form method="GET" action="query_url.asp">
Search Text <input type="text" name="qu" size="34">
Maximum Hits <input type="text" name="mh" size="20">
Sort By: <select name="sd" size="1">
     <option value="DocAuthor">Document Author</option>
     <option value="Filename">Filename</option>
     <option value="size">Size</option>
     </select>
Allow Enumeration: <select name="ae" ; size="1">
     <option value="1">True</option>
     <option value="0">False</option>
     </select>
Catalog: <input type="text" name= "ct"value="Web" size="20">

The asp page that the form is posted to contains this server side code:

File Query_url.asp:

<% 'Create a Query object, initialize it using SetQueryFromURL and show object state
Set objQuery = Server.CreateObject("ixsso.Query") ObjQuery.SetQueryFromURL(Request.QueryString) %>
 

 

Any of the properties of the query object can be displayed in this page.
Enclose the object.property in <% and preface it with an = e.g.   <% =objQuery.Query %> <% =Query.Catalog %>

 

Ursula Wojcik

 

[Home] [Search Articles] [Index Server Info] [In the News] [Future Use]