HOME  |  AJAX  |  SOLUTIONS  |  TECHNOLOGIES  |  E-COMMERCE  |  ABOUT US  |  JOBS
Rescan Programmatically
I recently discovered there is a whole wealth of adminstration functions you can run on the Indexing Server from code.  The one that I will probably be using the most is the ability to rescan a catalog from code.

Some of the site's that I manage have documents that get added and deleted all the time.  All these documents are searchable via IXSSO and the Indexing Server.  The problem was that no one ever rescaned the catalog, so old entries would end up in the search results that shouldn't be there.

My original solution was to just create a scheduled task that ran once a week to rescan the catalog.  Then I ran across a neat little bit of code that allows you to rescan the catalog right from your code.  Now anytime a file is deleted or replaced, I automatically start a rescan of the catalog.

So here is how I accomplished this with a current .NET project that I'm working on.  I haven't spent a lot of time with this, so there may be a better way of doing this.
Dim admin As New CIODMLib.AdminIndexServer
Dim Iadmin As CIODMLib.ICatAdm = admin.GetCatalogByName("MyCatalog")
Dim i As CIODMLib.IScopeAdm = Iadmin.GetScope
i.Rescan(True)
You have to include a reference to CIODMLib.dll located in your %WINDOWS%/System32 directory in order to create the CIODMLib objects to run the Indexing server adminstration functions.