Implementing Site Server Search on Your E-Commerce Site

Editor's Note: Each month, this column discusses various aspects of the advanced administration of e-commerce sites. This month's column examines Microsoft Site Server Search.

If you're familiar with Site Server 3.0, you know that the product delivers power at the expense of easy-to-use technology. Many of the technology features this enormous product contains you can unleash only by writing code. This month, I show you how to set up, configure, and implement one of the most powerful technologies in Site Server 3.0—Site Server Search. Site Server Search is wizard driven and amazingly easy to configure and implement. Search's technology lets your users search content on your Web site.

You can use either wizards or custom configuration to create Site Server Search index catalogs. You can use Search to search ODBC-compliant databases, Web sites, file systems, Microsoft Exchange Server public folders, and newsgroups to gather and assimilate information. The creation of Active Server Pages (ASP) that performs the searches against the catalogs is also automatic and completely wizard driven.

You can create a Site Server search in two ways: from the Site Server Service Admin (Microsoft Management Console—MMC) and from the Site Server Service Admin (HTML)—often called Web Admin. Microsoft usually provides a Web-based administrative tool in addition to an MMC version in its server software so that administrators can use the Internet for remotely administering servers. To access Site Server Service Admin (HTML), select Start, Programs, Microsoft Site Server, Administration, Site Server Service Admin (HTML). To access the Site Server Service Admin (MMC) on your Site Server machine, choose Start, Programs, Microsoft Site Server, Administration, Site Server Service Admin (MMC).

In this article, I concentrate on the MMC version of the Site Server Service Admin tool. However, here's the trick: You can create ODBC searches only from Site Server Service Admin (HTML). Having functionality in one of the administrative tools and not in the other isn't uncommon in Site Server 3.0. The Site Server Service Admin (HTML) tool contains functionality that the Site Server Service Admin (MMC) administration tool doesn't have, and vice versa. This inconsistency in functionality can create serious confusion when you're looking for the tool that you need.

Creating a Site Server 3.0 search is simple. The Catalog Definition Wizard facilitates the entire process. (You can also manually build and configure a search.) The Catalog Definition Wizard is a four-step wizard in which you

  1. Give the index catalog a name
  2. Configure the starting address of the crawl
  3. Select the servers that will host the search
  4. Start the catalog build (optional)

Creating a Search Catalog and Search Pages for Your Web Site
Let's say you want to create a search of the content ASP, DOC, EXCH, HTM, HTML, PPT, TXT, and XLS on your Web site. First, run the Site Server Service Admin (MMC) on your Site Server machine. In Site Server Service Admin (MMC), click the plus signs (+) next to your computer name under Search and to expand the local server that is hosting the search services. Below that local server, the search services are Catalog Build Server and Search Server, as Screen 1 shows. The Catalog Build Server creates and maintains the index catalog, which keeps references to all the resources on your Web site. The Search Server is the engine that facilitates searches in the catalog. Right-click Catalog Build Server, and select New Catalog Definition with a Wizard. Click Next on the opening screen, then give your index catalog a name—most likely, this name would be the name of your Web site (in this example, InterKnowlogy). Catalog names are restricted to 39 alphanumeric characters with no spaces. Click Next, then specify the type of crawl you're going to perform in the dialog box that Screen 2 shows.

Three types of crawls are available from the Site Server Service Admin (MMC):

  • Web link crawl—follows links on your site and can optionally crawl offsite links to other Web sites, no matter where they are on the Internet or on your LAN
  • File crawl—starts in a directory on your server's file system and can optionally crawl the subdirectories contained therein
  • Exchange crawl—crawls all messages in an Exchange public folder

Choose File Crawl from the New Catalog Definition Wizard, then click Next to configure where to start the crawl. Type D:\inetpub\wwwroot (or whatever drive you've installed your Web site on). The default is to crawl all subdirectories, so leave the setting at the default. Click Next to select the Search host. (You can propagate your index catalog to multiple host servers, which you would most likely do in a Web farm.) For this example, select the default of your local server, and click Next to move to the final screen of the wizard. Select the Start Build Now check box, then click Finish. You can monitor the status either in the main window of Search in the MMC or in detail by right-clicking the Catalog Build server that is crawling, selecting Properties, then selecting Status.

When the crawl is complete, ASP appears so that you can execute a search on your Web site. Under the Search Server MMC snap-in, you'll see the search catalog that you just built (e.g., InterKnowlogy). Under the search catalog, click Search; the newly created ASP that performs the search executes in the MMC, as Screen 3 shows. Type something to search for, then click Search. I built a catalog against the commerce Web site (InterKnowlogy) that I constructed in my book, Beginning Site Server (Wrox 2000). As a result, I get one match off the Web site's home page, which Screen 4 shows. You can even copy the ASP code from the pages the MMC hosts into your site to give it content search functionality. To copy the ASP code generated by the New Catalog Definition Wizard, you first need to figure out how to locate and execute your search from a browser. An HTML frameset exists that facilitates searching the catalog you just built. This frameset is on the Administration Web site. The URL format of the search that I just built is http://localhost:8497/siteserver/knowledge/search.

Hosting the Newly Created Search on Your Web Site
Here's how to locate and copy the appropriate pages out of the Site Server Administration area and into your Web site. First, I suggest that you create a folder off your Web site called Search in which to host the search pages. Next, copy the pages and the images folder from the \microsoft site server\siteserver\knowledge\search directory to the Search folder you just created. Screen 5 shows the files that you need to copy.

Next, depending on the permissions of the Web site into which you've copied the search files, you might need to change permissions to give your users appropriate access to the search pages. If appropriate, give the Everyone group Read permission on the Search folder by right-clicking the folder in Windows Explorer and selecting Security to grant or verify that the Everyone group has Read permissions.

Now, execute your search from your browser to make sure that the search works properly after relocating it in your Web site. When you're successful, start thinking about changing the look and feel of your search pages and integrating this look and feel into a production Web site. For example, I like to change the HTML in searchleft.asp to display my company's logo instead of the Microsoft Search logo. Simply copy your company logo into the images folder that you copied into your site, and change the name of the .gif or .jpg file or point the <img src> to the location of your company logo's image file. If you know a little about HTML, you can easily change the background colors of the framesets or apply other formatting changes.

Keeping the Search Catalog Up-to-Date
Like much of the content on your Web site, search catalogs are static. As the content on your Web site changes, you'll want to refresh the search catalogs to keep them up-to-date. Fortunately, you can easily schedule an automated refresh process from the Site Server Service Admin (MMC). Begin by navigating to the search catalog that you just built. Right-click the search catalog, then select Properties. Click the Schedule Builds tab, which Screen 6 shows.

Most likely, you'll want to schedule an incremental build of your search catalog, which refreshes only the files that have changed in your search catalog. Full-search catalog builds can be extremely burdensome to your server and take a long time to complete, depending on the amount of content your server is cataloging and the speed of your server. I've heard of some full builds taking as long as a week to complete on some of the larger sites on the Internet.

Select the Incremental builds check box; the Incremental Builds Property dialog box will appear. You'll notice three tabs in the Property dialog box: Task, Schedule, and Settings. Click the Schedule tab, and choose the frequency and start time of the scheduled incremental builds. Obviously, sites that are content focused and dynamic will require more frequent incremental builds of the search catalog than Web sites that rarely change. I usually schedule the builds of small Web sites at 2:00 a.m., with a frequency of every night. You'll most likely want to time the length of your incremental builds (which you can facilitate through the MMC in a simple, manual process) to make sure that the builds start and finish in the time slots in which usage is lowest on your Web site. When you've configured the time and frequency of the incremental builds of your search catalog, Windows 2000 (Win2K) and Windows NT automatically create a task to do the work. Click OK when you're finished, and Windows will automatically schedule your incremental builds.

Next Month
Now that you've seen how easy it is to create a powerful search application and host it on your Web site, you have the foundation to start thinking about bigger and better search applications. Remember that you can create search catalogs that crawl offsite links as well. You can create complex search catalogs that you host in powerful Knowledge Management (KM) applications that include content not only from your file systems and Web sites but also from other Web sites on the Internet. For example, if you're like me, you store email messages in a local Microsoft Outlook Personal Folders (personal store—PST) file. The PST file that houses all the old messages can quickly become huge and unmanageable. If you were to move all those old messages to an Exchange public store, you could create a content search catalog against that store and quickly build a powerful and quick intranet application that searches your email messages.

In this column, you've seen how to create search catalogs and how to automatically schedule incremental builds on those catalogs to keep them fresh. You've seen how to leverage the ASP of Site Server Search by copying it into your Web site and to use your custom-built search catalog. Next month, I'll show you how to use Site Server Search to build an ODBC search, which uses a database (or other ODBC source) as its source for searching.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.