Click here to Skip to main content
15,880,608 members
Articles / Programming Languages / VBScript

Indexing Service (CISVC) Reporting Script

Rate me:
Please Sign up or sign in to vote.
4.50/5 (3 votes)
19 Jun 2006CPOL2 min read 27.4K   167   18  
A VBScript to generate an HTML Report on the status/details of Indexing Service (CISVC) Catalogs

Introduction

If you work with Indexing Service (CISVC) in Microsoft Windows 2000, you might be interested in having a periodic report emailed to you from the server.

At a previous job, I made extensive use of Indexing Service (CISVC) for keyword searching in the database. You might wonder why I didn't just use the SQL Full Text Indexing.. we did, but found the performance and controlling the process not adequate.

Details

The key component used to access the indexing service is:

  • AdminIndexServer (ProgID: Microsoft.ISAdm)

This component provides access to a number of objects and methods that are used to query the status of the indexing service and its catalogs.

Objects, methods and properties used:

  • AdminIndexServer (ProgID: Microsoft.ISAdm)
    • GetCatalogByName (returns CatAdm object)
  • CatAdm
    • CatalogName (gets the current catalog name)
    • IsUpToDate
    • IsCatalogRunning
    • IsCatalogPaused
    • IsCatalogStopped
    • IndexSize
    • TotalDocumentCount
    • DocumentsToFilter
    • PctMergeComplete
    • QueryCount
    • StateInfo (* bitwise lookup, below)

I've chosen to only report on the status of specific index catalogs, but you can loop through all of the index catalogs by using the methods FindFirstCatalog and FindNextCatalog.

Note that the status of the catalog is given in such a way that you can use bitwise operations to get multiple statuses from the one return value. Here's a list of the constants I've used to get the status of the indexing service catalog:

  • CI_STATE_SHADOW_MERGE = 1 '0x1
  • CI_STATE_MASTER_MERGE = 2 '0x2
  • CI_STATE_CONTENT_SCAN_REQUIRED = 4 '0x4
  • CI_STATE_ANNEALING_MERGE = 8 '0x8
  • CI_STATE_RECOVERING = 32 '0x20
  • CI_STATE_INDEX_MIGRATION_MERGE = 64 '0x40
  • CI_STATE_LOW_MEMORY = 128 '0x80
  • CI_STATE_HIGH_IO = 256 '0x100
  • CI_STATE_MASTER_MERGE_PAUSED = 512 '0x200
  • CI_STATE_READ_ONLY = 1024 '0x400
  • CI_STATE_BATTERY_POWER = 2048 '0x800
  • CI_STATE_USER_ACTIVE = 4096 '0x1000
  • CI_STATE_STARTING = 8192 '0x2000
  • CI_STATE_READING_USNS = 16384 '0x4000

I hope this is useful for anyone having to deal with indexing service. I had many painful hours as I dealt with some quirk.

I think it's fairly straight forward to understand, I've tried to keep it simple (I'm sure someone has a witty quip to insert here... something about being simple ;-)).

History

  • 19th June, 2006: Initial post

License

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


Written By
Web Developer
Canada Canada
Software developer by trade.. well I used to be, now I'm in that grey area where who knows what I do. But I still use software development in one way or another quite often. I actually work with osCommerce CRE Loaded for our online stores, and I have a couple tips on my website.

Finished my 'rocks for jocks' degree after 10+ years (physical geography). And I have to say that I use the knowledge and skills that I obtained while getting my degree every day... not! But if a glacier wanders through my neck of the woods I'm sure I'll be able answer everyone's questions.

Not that I'm a naturalist, but I love looking at and reading about interesting stuff in nature. For example, I took a photo of ants and aphids in a symbiotic relationship. You might be familiar with this relationship, but it's very cool.. though somewhat disturbing if you think of it.

And I should have been an engineer.. and not the train driving ones! Oh well, too late now.

Comments and Discussions

 
-- There are no messages in this forum --