Thanks for the code Jakie.
I added a snipet to the search.php to turn on a layer that was being searched if it was off by default.
below is the code I added an else statement at the end. Seems to work ok.
$featureSrvc = $siteConnection->CreateService(MgServiceType::Feat
//Create a temporary map runtime object, locate the layer
$map = new MgMap();
$layers = $map->GetLayers();
$layer = null;
for($i = 0; $i < $layers->GetCount(); $i++)
$layer = $layers->GetItem($i);
if($layer->GetName() == $layerName)
if($layer == null)
trigger_error(FormatMessage("SEARCHLAYERNOTFOUND", $locale, array($layerName)));