«indexer:set-mode» switching the indexers mode from the command line

Switching to the «Update by Schedule» («schedule») mode:

bin/magento indexer:set-mode schedule

Switching to the «Update on Save» («realtime») mode:

bin/magento indexer:set-mode realtime

See also: