Starting a crawl

Call the IasCrawler.startCrawl() method to start a crawl.

The syntax of the method is:
IasCrawler.startCrawl(CrawlId crawlId, CrawlMode crawlMode)
The crawlId parameter is a CrawlId object that has the crawl ID set. The crawlMode parameter is one of the following CrawlMode data types:
  • CrawlMode.FULL_CRAWL performs a full crawl and creates a crawl history.
  • CrawlMode.INCREMENTAL_CRAWL performs an incremental crawl and updates the crawl history. There are several cases in which the CrawlMode automatically switches over from INCREMENTAL_CRAWL to run a FULL_CRAWL. A full crawl runs in the following cases:
    • If a crawl has not been run before.
    • If the document conversion option has changed - either by being enabled or disabled.
    • If the repository properties have changed.
    • If any filters have been modified, added, or removed.
    • If any seeds have been removed.
    • If you are writing records to a Record Store instance that contains no generations.

This method does not return a value.

To start a 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. Instantiate a CrawlId object and then set 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.startCrawl() method with the crawl ID and the appropriate crawl mode. To catch exceptions, use a try block with the appropriate catch clauses.
    For example:
    try {
       crawler.startCrawl(crawlId, CrawlMode.INCREMENTAL_CRAWL);
    }
    catch (CrawlNotFoundException e) {
       System.out.println(e.getLocalizedMessage());
    }
If the IasCrawler.startCrawl() method fails, it throws an exception:
  • CrawlInProgressException occurs if the IAS Server is already running the specified crawl.
  • CrawlNotFoundException occurs if the specified crawl (the crawlId parameter) does not exist or is otherwise not found.
  • InvalidCrawlConfigException occurs if the configuration is invalid. You can call getCrawlValidationFailures() to return the list of crawl validation errors.
  • EidiException occurs if other problems prevent the crawl from running.