+

Search Tips   |   Advanced Search

Run one-off tasks


Overview

The SearchService MBean provides commands that allow you to create an indexing optimize task that is scheduled to run once and only once, 30 seconds after being called.

Start wsadmin.sh.

  1. If the time between issuing these commands is less than the polling interval for the Search scheduler, then tasks might not execute in the same order as the order in which the commands were issued.

  2. You should wait at least the duration of the poll interval after issuing the following commands before issuing another one of the commands:

    • indexNow()
    • indexNowWithOptimization()
    • optimizeNow()


Run one-off Search tasks

  1. Start wsadmin...

  2. Initialize the Search environment, and start the Search script interpreter:

      execfile("searchAdmin.py")

    If successful

      Search Administration initialized

  3. Runs to run one-off indexing tasks.

    SearchService.indexNow(String applicationNames)

    Create 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 Connections application to be indexed when the task is triggered. To index multiple applications, use a comma-delimited list. Valid values:

      • activities
      • all_configured
      • blogs
      • calendar
      • communities
      • dogear
      • ecm_files
      • files
      • forums
      • people_finder
      • profiles
      • status_updates
      • wikis

    Use all_configured instead of listing all indexable services to index all the applications.

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

      SearchService.indexNow("dogear, blogs")

    Returns an output in JSON format similar to the following:

    { 
    "success": true, 
    "result": [ 
    "roi-dogear-blogs-SunMay1109:45:02EDT2014" 
    ]
    }
    When the command runs successfully, "success": true, is printed to the wsadmin console. If the command does not run successfully, "success": false is printed to the wsadmin console. The created task name within “result” is always returned.

    SearchService.indexNowWithOptimization(String applicationNames)

    Create a one-off task that indexes the specified applications 30 seconds after being called, and performs an optimization operation at the end of the indexing operation. This command takes a single argument:

    • applicationNames. The name (or names) of the Connections application to be indexed when the task is triggered. To index multiple applications, use a comma-delimited list. Valid values:

      • activities

      • all_configured
      • blogs
      • calendar
      • communities
      • dogear
      • ecm_files
      • files
      • forums
      • people_finder
      • profiles
      • status_updates
      • wikis.

    The optimization operation is both CPU and I/O intensive. For this reason, the operation should be performed infrequently and, if possible, during off-peak hours.

    Note that when we install Connections, a search optimization task is set up to run every night by default. See Search default tasks for more information. For example:

      SearchService.indexNowWithOptimization("dogear, blogs")

    SearchService.optimizeNow()

    Create a one-off task that performs an optimize operation on the search index, 30 seconds after being called.

    The optimization operation is both CPU and I/O intensive. For this reason, the operation should be performed infrequently and, if possible, during off-peak hours.

    When you install Connections, a search optimization task is set up to run every night by default. See Search default tasks for more information. 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.


Parent topic:
Manage the Search index


Related:
Scheduling tasks
Recreate the search index after migrating from a Connections 4.0 deployment
Run one-off social analytics scheduled tasks
Search default scheduled tasks