Use SearchService commands to perform file content retrieval
tasks.
Before you begin
To edit configuration files, you must
use the IBM® WebSphere® Application Server wsadmin client.
See Starting the wsadmin
client for details.
About this task
Depending on the number of files to be indexed in your deployment, it can take a long time
to retrieve file content. To ensure that all content is retrieved and indexed, you can run the
indexNow command to retrieve all content. You can run indexNow either before or after the document
indexing service finishes. For example, to manually index files and all file content, you might
run the following
commands:
wsadmin>SearchService.indexNow("files")
wsadmin>SearchService.getFileContentNow("files")
wsadmin>SearchService.indexNow("files")
The
document indexing service can run on multiple nodes, making the download and conversion process
faster. When the document indexing task is scheduled, the Search application sends a message to all
the nodes to tell them to start the document indexing process locally. Each Search server starts
taking files from the cache and downloading and converting them. When a node retrieves a file, it
flags the file in the cache as claimed so that other nodes do not try to get content for that
file.
Procedure
To perform file content retrieval tasks, complete the
following steps.
- Start the wsadmin client from the following
directory of the system on which you installed the Deployment Manager:
app_server_root\profiles\dm_profile_root\bin
where app_server_root is
the WebSphere Application
Server installation directory and dm_profile_root is
the Deployment Manager profile directory, typically dmgr01.You
must start the client from this directory or subsequent commands that
you enter do not execute correctly.
- After the wsadmin command environment
has initialized, enter the following command to initialize the Search
environment and start the Search script interpreter:
execfile("searchAdmin.py")
If prompted to specify a service to connect to, type 1 to pick
the first node in the list. Most commands can run on any node. If
the command writes or reads information to or from a file using a
local file path, you must pick the node where the file is stored.When
the command is run successfully, the following message displays:
Search Administration initialized
- Use the following commands to perform file content retrieval
tasks.
- SearchService.getFileContentNow(String applicationNames)
Starts 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:
- ecm_files. Retrieves files from the Enterprise Content Management
repository. Only published files are retrieved; draft files are not
included.
- files. Retrieves files from the Files application.
- wikis. Retrieves files from the Wikis application.
- activities. Retrieves files from the Activities application.
For example:
SearchService.getFileContentNow("files")
- SearchService.retryContentFailuresNow(String applicationNames)
-
Tries failed attempts at downloading and converting files for the specified application
again.
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. Retrieves files from the Files application.
- wikis. Retrieves files from the Wikis application.
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; these tasks can be tried again.
For example:
SearchService.retryContentFailuresNow("wikis,files")
- 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.
- startBy. The time that is given to a task to fire before it is automatically canceled. This
argument is a string value that must be specified in Cron format.
- 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:
- ecm_files. Retrieves files from the Enterprise Content Management
repository. Only published files are retrieved; draft files are not
included.
- files. Retrieves files from the Files application.
- wikis. Retrieves files from the Wikis application.
- activities. Retrieves files from the Activities application.
- failuresOnly. Indicates that only the content of files for which the download and conversion
tasks failed should be retrieved. This argument is a Boolean.
For example:
SearchService.addFileContentTask("mine", "0 0 1 ? *
MON-FRI", "0 10 1 ? * MON-FRI", "wikis,files","true")
When
the command runs successfully, 1 is printed to the wsadmin console.
If the command does not run successfully, 0 is printed to the wsadmin
console.
You can also use the SearchService.addFileContentTask command to
replace the task definition for the default 20min-file-retrieval-task. By default, this task runs
every 20 minutes, except for a one-hour period between 01:00 and 02:00. To replace the default task
settings, first remove the existing task with the SearchService.deleteTask(String taskName)
command. Then, use the SearchService.addFileContentTask to create a new task with the values that
you specify.
For example:
SearchService.deleteTask("20min-file-retrieval-task")
SearchService.addFileContentTask("20min-file-retrieval-task",
"0 1/20 0,2-23 * * ?", "0 10/20 0,2-23 * * ?",
"all_configured", "false")
- SearchService.listFileContentTasks()
-
Lists all the scheduled file content retrieval tasks.
This
command does not take any input parameters.
- SearchService.enableTask(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.enableTask("mine")
- SearchService.disableTask(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.disableTask("mine")