Starting a Background Search
The following Java™ and C# code examples demonstrate how to
start a background search by instantiating a subclass of the CmBackgroundSearch class
and setting its property values.
- Create an instance of the
CmBackgroundSearchsubclass that represents the search. - Supply a value to the parameter-defining custom property of the
CmBackgroundSearchobject that you created. - Save the
CmBackgroundSearchobject. The server then starts the background search automatically.
About this task
Java Example
// Instantiate CmBackgroundSearch subclass that was previously defined.
CmBackgroundSearch objBkSearch = Factory.CmBackgroundSearch.createInstance(objObjectStore, "objClassDefBkSearchSub");
// Set value of the custom property for the StartDate parameter.
objBkSearch.set_StartDate("2014-01-01T00:00:00Z");
// Save background search object to start the search.
objBkSearch.save(RefreshMode.REFRESH);
C# Example
// Instantiate CmBackgroundSearch subclass that was previously defined.
ICmBackgroundSearch objBkSearch = Factory.CmBackgroundSearch.CreateInstance(objObjectStore, "objClassDefBkSearchSub");
// Set value of the custom property for the StartDate parameter.
objBkSearch.StartDate = "2014-01-01T00:00:00Z";
// Save background search object to start the search.
objBkSearch.Save(RefreshMode.REFRESH);