Save Method

This method saves any changes to the Search schema.

Syntax

ISearchSchema.Save

Remarks

You must call this method to save any changes you've made to the Search schema. Otherwise, the changes disappear once your program exits.

Save validates some of the changes made to the IColumns and IStoplists interfaces, and can return an error based on an invalid or duplicate value in either interface.

You should check the Err.Number property after each interface method and the Save method to ensure that your changes were successful.

You should only call the Save method once—make all of your changes to the Search schema and then call Save. However, if you must call the Save method more than once, release and reload the schema by calling the BuildCatalog.Schema (see Accessing an ISearchSchema Object).

Example

The following example adds the VBScript document property to the indexed Search schema for the KMSampleCatalog2 catalog definition.

Option Explicit 
On Error Resume Next

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objSchema, objColumns, objColumn 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1")
Set objBuildServer = objSearchAdmin.BuildServer
Set objCatalogs = objBuildServer.BuildCatalogs 
Set objCatalog  = objCatalogs("KMSampleCatalog2")
Set objSchema   = objCatalog.objSchema
Set objColumns  = objSchema.objColumns 
Set objColumn   = objColumns("VBScript")

objColumn.Index = True
objSchema.Save

'Release objects
Set objColumn   = Nothing 
Set objColumns  = Nothgin 
Set objSchema   = Nothing 
Set objCatalog  = Nothing 
Set objCatalogs = Nothing 
Set objBuildServer = Nothing 
Set objSearchAdmin = Nothing 
 

See Also

IColumns, IStoplists


© 1997-1998 Microsoft Corporation. All rights reserved.