Disable Search API index running on Dev and Stage servers on Acquia

disable_search_indexing_on_non_prod.php
<?php
/**
 * ENV AH_NON_PRODUCTION is set on dev and test on 
 *   acquia servers but not local servers.
 */
function cga_utility_search_api_index_load($indexes) {
  if( isset($_ENV['AH_NON_PRODUCTION']) ) {
    foreach ($indexes as &$index) {
      $index->read_only = "1";
    }
  }
}