Indexing collections that contain categories

When you index a collection with support for categories enabled, you must do the following: