The VerityDomainConfiguration
interface contains the properties to designate the Verity master server, as well as the properties that are common to all Verity servers in the domain. There can be only one VerityDomainConfiguration
instance per domain.
The general sequence for configuring the Verity servers in a domain is as follows:
Java Example
// Create a VerityDomainConfiguration instance. // Assumes you have the ObjectStore object. Domain myDomain = myOS.get_Domain(); VerityDomainConfiguration verityDomain = Factory.VerityDomainConfiguration.createInstance(myDomain); // Assign the Verity master server and port. String myMachine = "localhost"; verityDomain.set_VerityMasterAdminServerHostname(myMachine); verityDomain.set_VerityMasterAdminServerPort(new Integer(9950)); // Specify security for the Verity domain, setting the user domain, user name, // password, and group. String myUser = "gwillikers"; byte[] myPassword = {'n', '2', 'n'}; String myGroup = "P8Admin"; verityDomain.set_UserDomain(myDomain.get_Name()); verityDomain.set_UserName(myUser); verityDomain.set_UserPassword(myPassword); verityDomain.set_UserGroup(myGroup);
C# Example
// Create a VerityDomainConfiguration instance. // Assumes you have the ObjectStore object. IDomain myDomain = os.Domain; IVerityDomainConfiguration verityDomain = Factory.VerityDomainConfiguration.CreateInstance(myDomain); // Assign the Verity master server and port. string myMachine = "localhost"; verityDomain.VerityMasterAdminServerHostname = myMachine; verityDomain.VerityMasterAdminServerPort = 9950; // Specify security for the Verity domain, setting the user domain, user name, // password, and group. string myUser = "gwillikers"; byte [] myPassword = { (byte)'n', (byte) '2', (byte)'n' }; string myGroup = "P8Admin"; verityDomain.UserDomain = myDomain.Name; verityDomain.UserName = myUser; verityDomain.UserPassword = myPassword; verityDomain.UserGroup = myGroup;
The Verity server configuration properties reference the host of a Verity server installation. The properties are performance-related, and contained in the VerityServerConfiguration
interface. In general, you should not change the default values for these properties unless you are having performance issues. However, if the Verity server contains multiple CPUs, or your deployment distributes processing across multiple Verity index servers, you should increase the value of the ThreadCount property. For example:
Java Example
// Increases the ThreadCount value from the default of 8 to 16 on all // VerityServerConfiguration instances in the domain. You could also use // Factory.VerityServerConfiguration.createInstance() and set the thread // count on the new instance. Domain domain = os.get_Domain(); Iterator iterator1 = domain.get_SubsystemConfigurations().iterator(); while (iterator1.hasNext()) { SubsystemConfiguration subsystem = (SubsystemConfiguration) iterator1.next(); if (subsystem instanceof VerityServerConfiguration) ((VerityServerConfiguration) subsystem).set_ThreadCount(new Integer(16)); } domain.save(RefreshMode.NO_REFRESH);
C# Example
// Increases the ThreadCount value from the default of 8 to 16 on all // VerityServerConfiguration instances in the domain. You could also use // Factory.VerityServerConfiguration.createInstance() and set the thread // count on the new instance. IDomain domain = os.Domain; foreach (ISubsystemConfiguration subsystem in domain.SubsystemConfigurations) { if (subsystem is IVerityServerConfiguration) { System.Console.WriteLine("Setting thread count"); ((IVerityServerConfiguration)subsystem).ThreadCount = 16; } } domain.Save(RefreshMode.NO_REFRESH);
The VerityIndexArea
interface contains properties to configure an index area for an object store. You can have multiple index areas per object store.
The general sequence for configuring an index area is as follows:
Java Example
// Create a VerityIndexArea instance to store the VerityCollection objects (created // automatically) that contain the full-text indexing information. Ensure the // ObjectStore.CBRLocale property is set to the appropriate locale for full-text // indexing. // Assumes you have the ObjectStore object. Sets the Verity locale used for full-text // indexing in this object store to French. os.set_CBRLocale("frenchv"); os.save(RefreshMode.NO_REFRESH); VerityIndexArea myIndexArea = Factory.VerityIndexArea.createInstance(os, null); // Assign the index servers and search servers to associate with this index area, and // specify the search servers to use for any newly created VerityCollection instance. // Assign the index and search servers. The parameters are StringList objects. StringList myIndexServers = Factory.StringList.createList(); // Assumes you have the machine name. myIndexServers.add(machineName); myIndexArea.set_VerityIndexServers(myIndexServers); StringList mySearchServers = Factory.StringList.createList(); // Assumes you have the machine name. mySearchServers.add(machineName); myIndexArea.set_VeritySearchServers(mySearchServers); // Set the number of search servers (from those assigned) to use for new collections. // The servers are automatically selected based on the least number of collections // associated. myIndexArea.set_SearchServersToAttach(new Integer(2)); // Set the file system path to use for this index area. For example: String path = "c:\\index1"; myIndexArea.set_RootDirectoryPath(path); // Set the maximum number of VerityCollection instances that can be created for this // index area. myIndexArea.set_MaxCollections(new Integer(6)); // Set the display name. myIndexArea.set_DisplayName("verity index"); // Set the status (open, closed, standby, full). myIndexArea.set_ResourceStatus(ResourceStatus.OPEN); // Specify the site. myIndexArea.set_Site(os.get_Site()); // Save the index area. myIndexArea.save(RefreshMode.NO_REFRESH);
C# Example
// Create a VerityIndexArea instance to store the VerityCollection objects (created // automatically) that contain the full-text indexing information. Ensure the // ObjectStore.CBRLocale property is set to the appropriate locale for full-text // indexing. // Assumes you have the ObjectStore object. Sets the Verity locale used for full-text // indexing in this object store to French. os.CBRLocale = "frenchv"; os.Save(RefreshMode.NO_REFRESH); IVerityIndexArea myIndexArea = Factory.VerityIndexArea.CreateInstance(os, null); // Assign the index servers and search servers to associate with this index area, and // specify the search servers to use for any newly created VerityCollection instance. // Assign the index and search servers. The parameters are StringList objects. IStringList myIndexServers = Factory.StringList.CreateList(); // Assumes you have the machine name. myIndexServers.Add(machineName); myIndexArea.VerityIndexServers = myIndexServers; IStringList mySearchServers = Factory.StringList.CreateList(); // Assumes you have the machine name. mySearchServers.Add(machineName); myIndexArea.VeritySearchServers = mySearchServers; // Set the number of search servers (from those assigned) to use for new collections. // The servers are automatically selected based on the least number of collections // associated. myIndexArea.SearchServersToAttach = 2; // Set the file system path to use for this index area. For example: string path = "c:\\index1"; myIndexArea.RootDirectoryPath = path; // Set the maximum number of VerityCollection instances that can be created for this // index area. myIndexArea.MaxCollections = 6; // Set the display name. myIndexArea.DisplayName = "verity index"; // Set the status (open, closed, standby, full). myIndexArea.ResourceStatus = ResourceStatus.OPEN; // Specify the site. myIndexArea.Site = os.Site; // Save the index area. myIndexArea.Save(RefreshMode.NO_REFRESH);
An index job consists of items that you have selected for indexing and other configuration properties for the job. The items can be classes, Verity collections, or single objects. You can create, monitor, and abort index jobs.
Use the IndexJob
interface to create and configure index jobs. The items that can be indexed are assigned using the IndexJobClassItem
, IndexJobCollectionItem
, and IndexJobSingleItem
interfaces.
The general sequence for creating and configuring an index job is as follows:
Java Example
// Create a VerityDomainConfiguration instance. // Assumes you have the ObjectStore object. IndexJob indexJob = Factory.IndexJob.createInstance(os); // Create the job item list to hold the items to index. IndexJobItemList indexJobItemList = Factory.IndexJobItem.createList(); // Designate the IndexJobClassItem, IndexJobCollectionItem, // or IndexJobSingleItem items to index. // To index a class, create the instance for the class item. IndexJobClassItem indexJobClassItem = Factory.IndexJobClassItem.createInstance(os); // Creates the ClassDefinition object for the class item. ClassDefinition classDef = Factory.ClassDefinition.getInstance(os, null); // Specify the class to index indexJobClassItem.set_ClassDefinition(classDef); indexJobItemList.add(indexJobClassItem); // To index a collection, create the instance for the collection item IndexJobCollectionItem indexJobCollectionItem = Factory.IndexJobCollectionItem.createInstance(os); // Get the index area instance. Assumes a valid IndexArea GUID. VerityIndexArea myIndexArea = Factory.VerityIndexArea.fetchInstance(os, new Id("{E7961EFD-BB0C-4ACA-9B41-35E3AD8E2770}"), null); // Get the list of VerityCollection objects. Selects the initial collection for indexing. VerityCollectionList verityList = myIndexArea.get_VerityCollections(); VerityCollection verityCollection = (VerityCollection) verityList.get(0); // Specify the collection to index. Id myCollectionID = verityCollection.get_Id(); indexJobCollectionItem.set_IndexationId(myCollectionID); indexJobItemList.add(indexJobCollectionItem); // To index an object, create the instance for the object item. IndexJobSingleItem indexJobSingleItem = Factory.IndexJobSingleItem.createInstance(os); // Specify the object to index; in this case, the root folder for the object store. // Note that in practice, indexing the root folder may be a considerably long, // processing-intensive operation. indexJobSingleItem.set_SingleItem(os.get_RootFolder()); indexJobItemList.add(indexJobSingleItem); // Specify the index job items and save the index job. indexJob.set_IndexItems(indexJobItemList); indexJob.save(RefreshMode.REFRESH);
C# Example
// Create a VerityDomainConfiguration instance. // Assumes you have the ObjectStore object. IIndexJob indexJob = Factory.IndexJob.CreateInstance(os); IIndexJobItemList indexJobItemList = Factory.IndexJobItem.CreateList(); // Create the job item list to hold the items to index. IIndexJobClassItem indexJobClassItem = Factory.IndexJobClassItem.CreateInstance(os); // Designate the IndexJobClassItem, IndexJobCollectionItem, // or IndexJobSingleItem items to index. // Creates the ClassDefinition object for the class item. IClassDefinition classDef = Factory.ClassDefinition.GetInstance(os, null); // To index a class, create the instance for the class item. indexJobClassItem.ClassDefinition = classDef; // Specify the class to index indexJobItemList.Add(indexJobClassItem); // To index a collection, create the instance for the collection item IIndexJobCollectionItem indexJobCollectionItem = Factory.IndexJobCollectionItem.CreateInstance(os); // Get the index area instance. Assumes a valid IndexArea GUID. IVerityIndexArea myIndexArea = Factory.VerityIndexArea.FetchInstance(os, new Id("{E7961EFD-BB0C-4ACA-9B41-35E3AD8E2770}"), null); // Get the list of VerityCollection objects. Selects the initial collection for indexing. IVerityCollectionList verityList = myIndexArea.VerityCollections; IVerityCollection verityCollection = (IVerityCollection)verityList[0]; // Specify the collection to index. Id myCollectionID = verityCollection.Id; indexJobCollectionItem.IndexationId = myCollectionID; indexJobItemList.Add(indexJobCollectionItem); // To index an object, create the instance for the object item. IIndexJobSingleItem indexJobSingleItem = Factory.IndexJobSingleItem.CreateInstance(os); // Specify the object to index; in this case, the root folder for the object store. // Note that in practice, indexing the root folder may be a considerably long, // processing-intensive operation. indexJobSingleItem.SingleItem = os.RootFolder; indexJobItemList.Add(indexJobSingleItem); // Specify the index job items and save the index job. indexJob.IndexItems = indexJobItemList; indexJob.Save(RefreshMode.REFRESH);
The IndexStatus
class contains the constants reflecting the current status of an index job. Use IndexJob.get_JobStatus
to return the associated IndexStatus
object. For example:
Java Example
indexJob.refresh(); System.out.println("JobStatus : " + indexJob.get_JobStatus().toString());
C# Example
indexJob.Refresh(); System.Console.WriteLine("JobStatus : " + indexJob.JobStatus.ToString());
The possible IndexStatus
property values are: Pending, InProgress, AbortInProgress, TerminateNormally, or TerminatedAbnormally.
You can submit a request to abort a pending index job by setting the Boolean value of IndexJob.JobAbortRequested
. For example:
Java Example
indexJob.set_JobAbortRequested(Boolean.TRUE);
C# Example
indexJob.JobAbortRequested= true;