This is a stand alone script which can be called to reindex a Magento 2 Site

The script will create a unique instance of the Magento Object Manager and use it to loop through all the indexes in the registry. You shouldn’t need to modify the script for any third party indexes that may be added by modules, as long as they have been properly registered.