Rescanning All Scopes

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 GetCatalogByName method of the gCiAdmin AdminIndexServer object to create CiCatalog, a CatAdm object. It then uses the FindFirstScope and FindNextScope methods of the CiCatalog CatAdm object to enumerate all scopes of the catalog. For each found scope, it uses the GetScope method of the CiCatalog CatAdm object to create CiScope, a ScopeAdm object. It then uses the Rescan method of the ScopeAdm object to rescan the scope. The ScanAllScopes procedure is called whenever the option to force a full rescan of all scopes of the catalog is selected on the form.

Private Sub ScanAllScopes()
...
    Dim CiCatalog As Object
    Dim CiScope   As Object
    Dim fFound    As Boolean

    Set CiCatalog = ISAdminForm.gCiAdmin.GetCatalogByName(Tag)

    fFound = CiCatalog.FindFirstScope
    While (fFound)
        Set CiScope = CiCatalog.GetScope()
        CiScope.Rescan True ' Full rescan.
        Set CiScope = Nothing

        fFound = CiCatalog.FindNextScope
    Wend
...
End Sub