Limit the indexing process to a certain number of items

When you experience issues with a source containing many items or when you plan to create a large source, you may want to ensure that the configuration is adequate so that your source rebuilds or builds without errors.

However, since there are many items to process, the source rebuild may take several hours or days. To avoid waiting for the whole process to complete, you can use the DocumentCountLimit source parameter to have the rebuild stop after a certain number of items are indexed.

While it is useful when developing or troubleshooting a source configuration, the DocumentCountLimit parameter is meant to be applied temporarily since it prevents you from refreshing or rescanning the source.

To limit a source rebuild to a certain number of items

Important

All items that aren’t indexed during this rebuild will be deleted. For example, if you set the DocumentCountLimit parameter 50 items, the rest of the source items would be deleted.

Therefore, the DocumentCountLimit parameter should only be used for troubleshooting or development purposes in a non-production Coveo organization.

  1. Duplicate the source with which you experience issues.

  2. Edit the source to set the Content security parameter to Specific users and groups and apply a tentative fix.

  3. Save the source configuration.

  4. Edit the source JSON configuration to add the DocumentCountLimit parameter in the parameters section with the following JSON configuration:

     "DocumentCountLimit": {
         "Value": <NumberOfItems> 1
     }
    1 Replace <NumberOfItems> with the desired number.
  5. Click Save and rebuild to launch the indexing process. The operation will take place until the number of indexed items is reached. Then, the rebuild operation stops.

    Note

    The actual number of indexed items may be slightly different from the value you specified. However, the difference should be minor.

  6. Once your fix works, apply it to the original source.

  7. When you’re ready to start indexing all source items, delete the DocumentCountLimit object from the source JSON configuration, and then rebuild the source.