magento 2 indexer different status code example
Example 1: set indexer mode command line magento 2
bin/magento indexer:set-mode {realtime|schedule} [indexer]
Example 2: set indexer on sheduled magento 2
bin/magento indexer:set-mode schedule indexername