Home

 

SearchService commands


The SearchService commands are used to set scheduled task definitions for the indexing and optimization search operations. To use the MBean commands listed in the following table, first initialize the search configuration environment.

Command Description
SearchService.addIndexingTask(String taskName, String schedule, String startBy, String featureNames, Boolean optimizeFlag) Creates a new scheduled indexing task definition in the Home page database.

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.

featureNames The name (or names) of the IBM Lotus Connections feature to be indexed when the task is triggered. This argument is a string value. To index multiple features, use a comma-delimited list. The following values are valid:

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("mine", "0 0 1 ? * MON-FRI", "0 10 1 ? * MON-FRI", "dogear,blogs","true")

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 feature is next restarted.

SearchService.addOptimizeTask(String taskName, String schedule, String startBy) Creates a new index optimization scheduled task definition.

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.

All arguments are required. For example:

    SearchService.addOptimizeTask("yours", "0 0 1 ? * MON-FRI", "0 10 1 ? * MON-FRI")

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 feature is next restarted.

SearchService.deleteTask(String taskName) Deletes the task definition with the specified name from the Home page database

  • taskName. The name of the scheduled task. This argument is a string value, which must be unique.

For example:

    SearchService.deleteTask("mine")

The refreshTasks() command should be used after this command for the deletion of task definitions to take effect immediately. Otherwise, the changes take place when the search feature is next restarted.

SearchService.indexNow(String featureNames) Creates a one-off task that indexes the specified services 30 seconds after being called

  • featureNames. The name (or names) of the IBM Lotus Connections feature to be indexed when the task is triggered. This argument is a string value. To index multiple features, use a comma-delimited list. The following values are valid: activities, blogs, communities, dogear, files, profiles, and wikis.

An optimize operation is not run at the end of the indexing operation. For example:

    SearchService.indexNow("dogear, blogs")

SearchService.indexNowWithOptimization(String featureNames) Creates a one-off task that indexes the specified services 30 seconds after being called

  • featureNames. The name (or names) of the IBM Lotus Connections feature to be indexed when the task is triggered. This argument is a string value. To index multiple features, use a comma-delimited list. The following values are valid: activities, blogs, communities, dogear, files, profiles, and wikis.

For example:

    SearchService.indexNowWithOptimization("dogear, blogs")

SearchService.optimizeNow() Creates a one-off task that performs an optimize operation on the search index, 30 seconds after being called.

The command does not accept any input parameters.

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 WebSphere Application Server 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 feature is next restarted.

  • SearchService.addIndexingTask()
  • Search.Service.addOptimizeTask()
  • SearchService.deleteTask()

This command does not accept any input parameters.

SearchService.disableIndexingTask(String taskName) Disables the indexing task with the specified name.

  • taskName. The name of the task to be disabled. This argument is a string value.

Using 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 a feature, the search feature stops indexing.

Results for the current feature that is being indexed are discarded but, if, as part of an indexing task, some features have been successfully crawled, those features 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. The next time that the search feature is restarted, all indexing tasks are re-enabled. For example:

    SearchService.disableIndexingTask("mine")

The disabled task remains disabled until the server is restarted or until the task is re-enabled.

SearchService.enableIndexingTask(String taskName) Enables the indexing task with the specified name. This command uses the current schedule.

  • taskName. The name of the task to be enabled. This argument is a string value.

For example:

    SearchService.enableIndexingTask("mine")

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.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.

 

Related tasks

Manage the index
Accessing the search configuration environment

Add scheduled tasks

Listing scheduled tasks

Delete scheduled tasks

Enable and disable indexing tasks

Running one-off tasks


+

Search Tips   |   Advanced Search