Fixes saving categories for selection products and optimizes index rebuild performance