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 operation may take several hours or days. To avoid waiting for the whole process to complete, you can configure the source so that the operation stops after a certain number of items are indexed.

To limit a source rebuild to a certain number of items

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 Source creator 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>
     }
    

    where you replace <NumberOfItems> with the desired number.

    • Once you added the DocumentCountLimit parameter, you can’t refresh or rescan your source (see Refresh VS Rescan VS Rebuild). Therefore, this option is meant to be applied temporarily, while you ensure that the source configuration is adequate.

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

  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.

What’s Next

  • When the fix works, apply it to the configuration of the original source.

  • (For a large new source) When you’re ready to start indexing all source items, delete the DocumentCountLimit object from the source JSON configuration, and then, rebuild the source.

Recommended Articles