index config magento 2 code example
Example 1: run partial indexing from command line magento 2
bin/magento cronmanager:runjob indexer_update_all_views
Example 2: set indexer mode command line magento 2
bin/magento indexer:set-mode {realtime|schedule} [indexer]