Updating crawl configurations

Call the IasCrawler.updateCrawl() method to change the configuration settings for an existing crawl.

The syntax of the method is:
IasCrawler.updateCrawl(CrawlConfig crawlConfig)

The crawlConfig parameter is a CrawlConfig object that has the configuration settings of the crawl.

If you update a crawl configuration and specify an empty ModuleProperty for a password property, the crawl configuration reuses the password stored on IAS Server.

Note: You cannot change the configuration if the crawl is running.

To update the configuration settings of an existing crawl:

  1. Make sure that you have created a connection to the IAS Server. (An IasCrawler object named crawler is used in this example.)
  2. Set the name for the crawl to be modified by first instantiating a CrawlId object and then setting its ID in the constructor.
    For example:
    // Create a new crawl Id with the name set to Demo.
    CrawlId crawlId = new CrawlId("Demo");
  3. Call the IasCrawler.getCrawlConfig() method to retrieve the current configuration.
    For example:
    CrawlConfig crawlConfig = crawler.getCrawlConfig(crawlId, false);
  4. Change the configuration settings as desired.
  5. Update the file system crawl by using the IasCrawler.updateCrawl() method with the previously created crawlConfig.
    For example:
    crawler.updateCrawl(crawlConfig);

If the IasCrawler.updateCrawl() method fails, it throws an exception:

To catch these exceptions, use a try block when you call the method.