by default indexer set shedule how to magento 2 code example
Example 1: magento 2 reindex
php bin/magento indexer:reindex
Example 2: set indexer mode command line magento 2
bin/magento indexer:set-mode {realtime|schedule} [indexer]
Example 3: set indexer on sheduled magento 2
bin/magento indexer:set-mode schedule indexername