Getting the Catalog Status

Note

Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.

 

This code segment uses the FindFirstCatalog and FindNextCatalog methods of the gCiAdmin AdminIndexServer object to enumerate all Indexing Service catalogs. For each found catalog, it uses the GetCatalog method of the gCiAdmin AdminIndexServer object to create CiCatalog, a CatAdm object. It then adds the CatalogLocation and other properties of the CiCatalog CatAdm object to the list view on the form that describes the status of each found catalog. The MakeCatalogColumns procedure is called when the application starts, whenever the Connect button is clicked, and at periodic intervals to update the catalog status information.

Private Sub MakeCatalogColumns()
...
    Dim CiCatalog As Object
    Dim lItem As ListItem
    Dim fFound As Boolean

    ' Loop, getting each catalog status info.
    fFound = gCiAdmin.FindFirstCatalog

    While (fFound)
        Set CiCatalog = gCiAdmin.GetCatalog

        Set lItem = ListView1.ListItems.Add(, , CiCatalog.CatalogLocation)

        If (gCiAdmin.IsRunning) Then
            lItem.SubItems(1) = CiCatalog.IndexSize
            lItem.SubItems(2) = CiCatalog.IsUpToDate
            lItem.SubItems(3) = CiCatalog.PendingScanCount
            lItem.SubItems(4) = CiCatalog.DocumentsToFilter
            lItem.SubItems(5) = CiCatalog.FilteredDocumentCount
            lItem.SubItems(6) = CiCatalog.TotalDocumentCount
            lItem.SubItems(7) = CiCatalog.PctMergeComplete
        End If
...
GetMoreProperties:
        Set CiCatalog = Nothing
        Set lItem = Nothing
        fFound = gCiAdmin.FindNextCatalog
    Wend

...
End Sub