SearchService commands
The SearchService commands are used to create, retrieve, update, and delete scheduled task definitions for the indexing and optimization Search operations.
SearchService commands
Use the MBean commands listed below to perform administrative tasks for Search. The commands are listed in alphabetical order.To use the commands, first initialize the Search configuration environment. For more information, see Access the Search configuration environment.
SearchService.addBackupIndexTask(String taskName, String schedule, String startbySchedule)
Defines a new scheduled index backup task.
This command takes the following arguments:
- taskName. The name of the task to be added.
- schedule. The time at which the scheduled task starts. This argument is a string value that must be specified in Cron format.
- startbySchedule. The time given for the task to run before it is automatically canceled. This argument is a string value that must be specified in Cron format.
For example:
SearchService.addBackupIndexTask("WeeklyIndexBackup","0 0 2 ? * SAT","0 10 2 ? * SAT")
SearchService.addFileContentTask(String taskName, String schedule, String startBy, String applicationNames, failuresOnly)
Creates a scheduled file content retrieval task.
This command takes the following arguments:
- taskName. The name of the scheduled task. This argument is a string value, which must be unique.
- schedule. The time at which the scheduled task starts. This argument is a string value that must be specified in Cron format. For more information about the Cron schedule, see Scheduling tasks.
- startBy. The time given to a task to fire before it is automatically canceled. This argument is a string value that must be specified in Cron format. For more information about the Cron schedule, see Scheduling tasks.
- applicationNames. The name (or names) of the IBM Connections application to be indexed when the task is triggered. This argument is a string value. To index multiple applications, use a comma-delimited list. The following values are valid:
- files
- wikis
- failuresOnly. A flag that indicates that only the content of files for which the download and conversion tasks failed should be retrieved. This argument is a boolean value.
For example:
SearchService.addFileContentTask("mine", "0 0 1 ? * MON-FRI", "0 10 1 ? * MON-FRI", "wikis,files","true")
SearchService.addIndexingTask(String taskName, String schedule, String startBy, String applicationNames, Boolean optimizeFlag)
Creates a new scheduled indexing task definition in the Home page database.
This command takes the following arguments:
- taskName. The name of the scheduled task. This argument is a string value, which must be unique.
- schedule. The time at which the scheduled task starts. This argument is a string value that must be specified in Cron format.
- startBy. The time given to a task to fire before it is automatically canceled. This argument is a string value that must be specified in Cron format.
This parameter should be used to ensure that indexing tasks are not queued up and running into server busy times. Under normal conditions, the only factors that might cause a task to be delayed are that overlapping or coincident tasks are trying to fire at the same time, or an earlier task is running for a long time.
- applicationNames. The name (or names) of the IBM Connections application to be indexed when the task is triggered. This argument is a string value. To index multiple applications, use a comma-delimited list. The following values are valid: activities, blogs, communities, dogear, files, forums, profiles, and wikis.
- optimizeFlag. A flag that indicates if an optimization step should be performed after indexing. This argument is a boolean value.
All arguments are required.
For example:
SearchService.addIndexingTask("customDogearAndBlogs", "0 0 1 ? * MON-FRI", "0 10 1 ? * MON-FRI", "dogear,blogs","true")Note: The refreshTasks() command should be used after this command for the new task definitions to take effect immediately. Otherwise, the changes take place when the Search application is next restarted.
SearchService.addOptimizeTask(String taskName, String schedule, String startBy)
Creates a new index optimization scheduled task definition.
This command takes the following arguments:
- taskName. The name of the scheduled task. This argument is a string value, which must be unique.
- schedule. The time at which the scheduled task starts. This argument is a string value that must be specified in Cron format.
- startBy. The time given to a task to fire before it is automatically canceled. This argument is a string value that must be specified in Cron format.
This parameter should be used to ensure that indexing tasks are not queued up and running into server busy times. Under normal conditions, the only factors that might cause a task to be delayed are that overlapping or coincident tasks are trying to fire at the same time, or an earlier task is running for a long time.
All arguments are required.
For example:
SearchService.addOptimizeTask("customOptimize", "0 0 1 ? * MON-FRI", "0 10 1 ? * MON-FRI")Note: The refreshTasks() command should be used after this command for the new task definitions to take effect immediately. Otherwise, the changes take place when the Search application is next restarted.
SearchService.addSandTask(String taskName, String schedule, String startBy, String jobs)
Creates a new scheduled indexing task definition for the social analytics service in the Home page database.
Note: Social analytic indexing is resource-intensive and consequently it should be performed at off-peak times.This command takes the following arguments:
- taskName. The name of the scheduled task. This argument is a string value, which must be unique.
- schedule. The time at which the scheduled task starts. This argument is a string value that must be specified in Cron format.
- startBy. The time given to a task to fire before it is automatically canceled. This argument is a string value that must be specified in Cron format.
This parameter should be used to ensure that indexing tasks are not queued up and running into server busy times. Under normal conditions, the only factors that might cause a task to be delayed are that overlapping or coincident tasks are trying to fire at the same time, or an earlier task is running for a long time.
- jobs. The name, or names, of the jobs to be run when the task is triggered. This argument is a string value. To index multiple jobs, use a comma-delimited list. The following values are valid: evidence, graph, manageremployees, tags, taggedby, and communitymembership.
All the arguments are required.
For example:
SearchService.addSandTask("customSaNDIndexTask", "0 0 1 ? * MON-FRI", "0 10 1 ? * MON-FRI", "evidence,graph,manageremployees,tags,taggedby,communitymembership")
SearchService.backupIndexNow()
Backs up the index immediately to the location specified by the IBM WAS variable, SEARCH_INDEX_BACKUP_DIR. There might be a delay before the backup occurs if there are indexing tasks in progress.
This command does not take any arguments.
After backing up the Search index using wsadmin commands, consider performing a full backup of the HOMEPAGE database. Note that the Search index has a dependency on data in the HOMEPAGE database.
SearchService.deleteFeatureIndex(String applicationName)
Removes and purges the content for the specified application from the Search index.
This command takes a string value, which is the name of the application whose content is to be deleted. The following values are valid: activities, blogs, communities, dogear, files, forums, profiles, and wikis.
For example:
SearchService.deleteFeatureIndex("activities")
SearchService.deleteTask(String taskName)
Deletes the task definition with the specified name from the Home page database.
This command takes a string value, which is the name of the task to be deleted. For information about how to retrieve the names of the tasks in the Home page database, see Listing scheduled tasks.
For example:
SearchService.deleteTask("profilesIndexingTask")
SearchService.disableFileContentTask(String taskName)
Disables the specified task.
This command takes a single argument:
- taskName. The name of the task to be disabled. This argument is a string value.
For example:
SearchService.disableFileContentTask("mine")
SearchService.disableIndexingTask(String taskName)
Disables the indexing task with the specified name.
This command takes a single argument:
- taskName. The name of the task to be disabled. This argument is a string value.
Use this command affects the indexing process as follows:
- When the command is run before the indexing task fires, the indexing operation is prevented from starting.
- When the command is run during the indexing operation for an application, the Search application stops indexing.
Results for the current application that is being indexed are discarded but, if, as part of an indexing task, some applications have been successfully crawled, those applications are up-to-date in the index. For example, if a task is fired that is to index Bookmarks, Blogs, and Activities (in that order) and the disable command is called while Blogs is being indexed, when the task is enabled again, Blogs and Activities resume indexing at the same point as the previously-called task. Disabled tasks remain disabled until they are re-enabled.
For example:
SearchService.disableIndexingTask("mine")
SearchService.enableFileContentTask(String taskName)
Enables the specified task.
This command takes a single argument:
- taskName. The name of the task to be enabled. This argument is a string value.
For example:
SearchService.enableFileContentTask("mine")
SearchService.enableIndexingTask(String taskName)
Re-enables the indexing task with the specified name. This command uses the current schedule.
This command takes a single argument:
- taskName. The name of the task to be enabled. This argument is a string value.
For example:
SearchService.enableIndexingTask("mine")
SearchService.getFileContentNow(String applicationNames)
Launches the file content retrieval task. This command iterates over the file cache, downloading and converting files that don't have any content.
This command takes a string value, which is the name of the application whose content is to be retrieved. The following values are valid:
- files
- wikis
For example:
SearchService.getFileContentNow("files")
SearchService.indexNow(String applicationNames)
Creates a one-off task that indexes the specified applications 30 seconds after being called.
This command takes a single argument:
- applicationNames. The name (or names) of the IBM(r) Lotus(r) Connections application to be indexed when the task is triggered. This argument is a string value. To index multiple applications, use a comma-delimited list. The following values are valid: activities, blogs, communities, dogear, files, forums, profiles, and wikis.
Note: An optimize operation is not run at the end of the indexing operation.
For example:
SearchService.indexNow("dogear, blogs")
SearchService.indexNowWithOptimization(String applicationNames)
Creates a one-off task that indexes the specified applications 30 seconds after being called.
This command takes a single argument:
- applicationNames. The name (or names) of the IBM(r) Lotus(r) Connections application to be indexed when the task is triggered. This argument is a string value. To index multiple applications, use a comma-delimited list. The following values are valid: activities, blogs, communities, dogear, files, forums, profiles, and wikis.
For example:
SearchService.indexNowWithOptimization("dogear, blogs")
SearchService.listFileContentTasks()
Lists all the scheduled file content retrieval tasks.
This command does not take any input parameters.
SearchService.listIndexingTasks()
Lists all scheduled indexing task definitions defined in the Home page database.
This command does not take any input parameters.
SearchService.listOptimizeTasks()
Lists all scheduled optimize task definitions defined in the Home page database.
This command does not take any input parameters.
SearchService.listTasks()
Lists all Search scheduled task definitions (indexing and optimize) defined in the Home page database.
This command does not take any input parameters.
SearchService.notifyRestore()
Brings the database to a consistent state so that crawlers start from the point that the backup was made from.
The notifyRestore command updates index management tables in the HOMEPAGE database so that crawling resume points are reloaded from a restored index, thereby ensuring that all future crawls start from the correct point. This command also purges cached content in the HOMEPAGE database.
SearchService.optimizeNow()
Creates a one-off task that performs an optimize operation on the search index, 30 seconds after being called.
This command does not accept any input parameters.
This operation should not be called during an indexing operation; if it needs to be run, do it at an off-peak time when the application is not expected to be performing intensive I/O operations on the index.
SearchService.optIntoSandByEmail(String email)
Includes the user with the specified email address in the social analytics service.
This command takes a single argument:
- email. The email address of the user who is to be included in the social analytics service. This argument is a string value.
For example:
SearchService.optIntoSandByEmail("ajones10@example.com")
SearchService.optIntoSandByExId(String externalId)
Includes the user with the specified external ID in the social analytics service.
This command takes a single argument:
- externalId. The external ID of the user who is to be included in the social analytics service. This argument is a string value.
For example:
SearchService.optIntoSandByExId("11111-1111-1111-1111")
SearchService.optOutOfSandByEmail(String email)
Excludes the user with the specified email address from the social analytics service.
This command takes a single argument:
- email. The email address of the user who is to be excluded from the social analytics service. This argument is a string value.
For example:
SearchService.optOutOfSandByEmail("ajones10@example.com")
SearchService.optOutOfSandByExId(String externalId)
Excludes the user with the specified external ID from the social analytics service.
This command takes a single argument:
- externalId. The external ID of the user who is to be excluded from the social analytics service. This argument is a string value.
For example:
SearchService.optOutOfSandByExId("11111-1111-1111-1111")
SearchService.refreshTasks()
Calls the server to read task settings from the Search task definition tables and synchronizes the configured tasks with those persisted in the IBM WAS scheduler tables.
This command should be used after the following commands for the changes to task definitions to take effect immediately. Otherwise, the changes take place when the Search application is next restarted.
- SearchService.addIndexingTask(String taskName, String schedule, String startBy, String applicationNames, Boolean optimizeFlag)
- SearchService.addOptimizeTask(String taskName, String schedule, String startBy)
- SearchService.deleteTask(String taskName)
This command does not accept any input parameters.
SearchService.removeIndexingNode(String nodeName)
Removes the specified node from the index management table.
This command takes a single argument:
- nodeName. The name of the node to be removed. This argument is a string value.
For example:
SearchService.removeIndexingNode("node3")
SearchService.retryContentFailuresNow(String applicationNames)
Retries failed attempts at downloading and converting files for the specified application.
This command takes a string value, which is the name of the application whose content is to be downloaded and converted. The following values are valid:
- files
- wikis
A file download or conversion task can fail for a number of reasons, for example, hardware or network issues. Failures are flagged in the cache and can be retried.
For example:
SearchService.retryContentFailuresNow("wikis,files")
SearchService.sandIndexNow(String jobs)
Creates a one-off task that indexes the specified services 30 seconds after being called.
Note: Social analytic indexing is resource-intensive and consequently it should be performed at off-peak times.This command takes a single argument:
- jobs. The name, or names, of the jobs to be run when the task is triggered. This argument is a string value. To run multiple jobs, use a comma-delimited list. The following values are valid: evidence, graph, manageremployees, tags, taggedby, and communitymembership.
For example:
SearchService.sandIndexNow("evidence,graph,manageremployees,tags,taggedby,communitymembership")
SearchService.saveMetricsToFile(String filePath)
Collects internal metrics and writes them to the specified file.
This command takes a single argument:filePath
The full path to a text file in which to store the metric information. This argument is a string value.
A file is created in the specified directory. The file name is prefixed with the string "searchMetrics-" and contains a timestamp indicating when the metrics were collected. The file output is printed in the following format:
================================================================ ACTIVITIES Average entry indexing time: 0.03 seconds Max entry indexing time: 0.17 Min entry indexing time: 0.01 Entry count: 54 Average seedlist request time: 1.83 seconds Max seedlist request time: 4.16 Min seedlist request time: 0.1 Seedlist request count: 3 ================================================================ PROFILES Average entry indexing time: 0.07 seconds Max entry indexing time: 1.48 Min entry indexing time: 0.04 Entry count: 1763 Average seedlist request time: 8.6 seconds Max seedlist request time: 13.06 Min seedlist request time: 0.14 Seedlist request count: 5
SearchService.startBackgroundIndex(String indexLocation, String services)
Creates a stand-alone index in a specified location.
This command takes two arguments:
- indexLocation. A string value that specifies the location where you want to create the background index.
- services. A string value that specifies the names of the applications that you want to include in the index crawl. The following values are valid: activities, blogs, communities, dogear, files, forums, profiles, and wikis.
For example:
SearchService.startBackgroundIndex("/opt/IBM/LotusConnections/backgroundIndex", "activities, blogs, communities, dogear, files, forums, profiles, wikis")
Parent topic
Manage the Search indexRelated concepts
Scheduling tasks
Related tasks
Access the Search configuration environment
Add scheduled tasks for Search
Listing scheduled tasks
Delete scheduled tasks for Search
Enable and disable indexing tasks
Running one-off tasks
Backing up the Search index using wsadmin commands
Purging forum trash on a schedule
Add indexing tasks for the social analytics widgets
Disable the social analytic widgets for individual users
IBM Connections configuration property values