indexer
Magento2 Indexing Change Mode programmatically
Magento2 Indexing Mode
You can set the mode via command line
php bin/magento indexer:set-mode {realtime|schedule} [indexer-name]
“realtime” is equal to “Update on Save” and “schedule” is equal to “Update by Schedule”.