Little used and much maligned, Windows XP's Indexing Service can really help you find data on workstations if you use it properly.
Posted by Mark Kaelin
This article was originally published on TechRepublic in February 2005 by a guest contributor.
If you're like most Windows XP users, you've probably read that the Indexing Service is unnecessary and that disabling it will improve the operating system's overall performance. Although these statements aren't entirely true, most people buy in to them because they really don't understand the benefits of using the Indexing Service.
If you regularly search for specific content in data files on your multigigabyte hard disk, the Indexing Service will definitely save you time and therefore can be considered a necessary service. In fact, I have literally thousands of articles in Word documents, and I've discovered that searching for content with the Indexing Service turns up results hundreds of times faster than using a standard search engine.
Furthermore, like a screen saver, the Indexing Service is designed to perform its intensive hard-disk indexing operations when the computer is idle. The service pauses whenever it senses activity from the keyboard or mouse, so it will never drag down system performance when you're using your computer.
Of course, like all tools in the Windows operating system, the Indexing Service's default settings can be tweaked in order to improve performance. For example, in its default configuration, the service is designed to search through all the files on your entire hard disk as it performs its indexing operation. However, the service is much more efficient if you redirect the indexing operations toward the directories, or folders, in which you store your data files.
In this blog post, we'll show you how to redirect the focus of the indexing operations and discuss other ways you can configure the Indexing Service so that it performs more efficiently.
How it works
Let's begin with a brief look at how the Indexing Service works. To provide such fast turnaround time, the service actually performs a comprehensive search operation during the indexing phase, when it goes through the files on your hard disk and gathers detailed information on each file. As it does, it creates a catalog, or database, of the results. When you run a search operation, you're actually searching through the database rather than searching through the files on your hard disk.
To determine what types of files to search for and how to search them, the Indexing Service uses a set of preconfigured filters. By default, the service comes with filters for HTML files, text files, and all files created by Microsoft Office, including e-mail. The filter also allows the service to isolate the meaningful text from other content in the document, such as header and formatting information.
In addition to using filters to determine how to search a file, the service has a list of noise words — words that don't need to be indexed. Words in the noise list include prepositions, common verbs, conjunctions, pronouns, individual letters, and numbers.
The service also gathers other pertinent information about the file. For example, it indexes standard information, such as file size, time and date stamp, and file type. More detailed information about a document includes word count, author, or even the last time the document was printed.
Works best on NTFS
While the Indexing Service will run on any hard disk regardless of the file system, it runs best on NTFS volumes, where it can take advantage of several advanced NTFS features. The most beneficial of these features is the NTFS Change Journal.
As its name implies, the Change Journal keeps a constantly updated log of any file deletions, additions, or modifications to all folders on the NTFS volume. The Indexing Service can consult with the Change Journal to help determine when new files have been added or when existing files have been modified; it can then proceed to update the index.
As you can imagine, a database of all the files on your hard disk could become extremely large. To deal with the size issue, the service stores its database using NTFS Sparse File, a feature that stores files in a way that requires much less disk space than if they were stored on a FAT-formatted hard disk.
Taking a look around
Now that you have a good idea of how the Indexing Service works, let's take a look at its default configuration via the Indexing Service console.To launch this console, go to the Run dialog box on the Start menu, type Ciadv.msc in the Open text box, and click OK. Once the console is up and running, select the Show/Hide Console Tree button on the toolbar to show the console tree. You'll then see the screen shown in Figure A.
By default, the Indexing Service is configured to index the entire hard disk.
Select the Directories folder in the tree to see a list of all the directories the service is configured to monitor. While these default settings ensure that data files on this computer will be included in the catalog, it forces the service to spend a lot of time searching through folders containing files that might not have the data you want to index.
For example, the C:\Windows folder on this particular system contains close to 17,000 files, which would take a lot of unnecessary time and disk space to index. The C:\Documents and Settings folder comes much closer to the data I'd like to index; however, this folder contains nearly 34,000 files, many of which aren't data files.
Redirecting the indexing operations
To make the Indexing Service as efficient as possible, you should redirect the indexing operations to the My Documents folder, which contains all your data files. This will make the service much more efficient.
First, delete all the current entries in the Directories list by right-clicking on each and selecting the Delete command from the menu. As you do, the Indexing Service will prompt you to confirm the deletion.To add an entry for the My Documents folder, go to the Action menu and select the New | Directory command. In the Add Directory dialog box, select the Browse button and type the path to the My Documents folder into the Path text box, as shown in Figure B. Then, click OK.
You can redirect the Indexing Service so that it focuses on the folders containing your data files.At this point, minimize the Indexing Service console, launch Windows Explorer, and locate the My Documents folder. Now, right-click on the My Documents folder to access the Properties dialog box. Click the Advanced button. In the Advanced Attributes dialog box, shown in Figure C, select the For Fast Searching, Allow Indexing Service to Index This Folder check box, and click OK.
To ensure that the folders and files are ready for the indexing operations, you need to set the Index attribute.To continue, click OK in the My Documents Properties dialog box. You'll then see the Confirm Attribute Changes dialog box, shown in Figure D. Make sure the Apply Changes to This Folder, Subfolders and Files check box is selected and click OK.
You'll be prompted to confirm that you want to set the Index attribute for all subfolders and files.Return to the Indexing Service console and select the Indexing Service on Local Machine folder in the tree. You'll then see the main System catalog, as shown in Figure E. Now click the Start Indexing button on the toolbar.
To initiate the indexing operation, just click the Start Indexing button on the toolbar.The Indexing Service will begin the indexing operation, and you should leave your system site idle for a while. Ideally, you'll allow the service to run while you're at lunch or even overnight in order to give it time to build the index. While the indexing operation is running, the service will keep you apprised of its status, as shown in Figure F.
While the indexing operation is ongoing, the Status column will show that it is scanning.When the indexing operation is complete, the Status column will list the operation as Started, as shown in Figure G. You can then close the Indexing Service, launch the Search tool, and begin searching your indexed files.
Once indexing is complete, the Status column will indicate that the index is ready to be searched.
Adding file types
As I mentioned, by default the Indexing Service comes with filters for HTML files, text files, and all files created by Microsoft Office. If you want to index other types of files, you can find and install custom content filters, also called IFilters. Because Microsoft's SharePoint Server also uses IFilters, you can find them for a lot of common file types.
For example, you can download and install a free PDF IFilter from the IT solutions page on the Adobe Web site. You can download and install a free Visio IFilter from the Downloads page on the Microsoft Web site. From the 4-Share Web site, you can download a 30-day evaluation copy of an IFilter for ZIP files. You can also purchase a number of IFilters on the IFilterShop Web site.
Adding unknown extensions
You can configure the Indexing Service to index files with unknown extensions. In this case, the service will analyze the content of the files and try to locate pertinent information.To do so, run the Indexing Service console as described earlier. Select the Show/Hide Console Tree button on the toolbar to show the console tree. Right-click on the Indexing Service on Local Machine folder in the tree and select the Properties command. In the Indexing Service on Local Machine Properties dialog box, select the Index Files with Unknown Extensions check box, as shown in Figure H, and click OK.
If you want the Indexing Service to attempt to pull relevant information from unknown file types, you can enable the Index Files with Unknown Extensions check box.
Stay on top of the latest XP tips and tricks with TechRepublic's Windows XP newsletter, delivered every Thursday. Automatically sign up today!