diff --git a/apachesolr.module b/apachesolr.module
index 440d4a0..c3eaacf 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -1810,14 +1810,18 @@ function apachesolr_entity_info_alter(&$entity_info) {
     $entity_info[$type]['apachesolr'] += $default;
   }
 
-  $env_id = apachesolr_default_environment();
+  $environments = apachesolr_load_all_environments();
   // For any supported entity type and bundle, flag it for indexing.
   foreach ($entity_info as $entity_type => $info) {
     if ($info['apachesolr']['indexable']) {
-      $supported = apachesolr_get_index_bundles($env_id, $entity_type);
-      foreach (array_keys($info['bundles']) as $bundle) {
-        if (in_array($bundle, $supported)) {
-          $entity_info[$entity_type]['bundles'][$bundle]['apachesolr']['index'] = TRUE;
+      foreach ($environments as $env) {
+        if (empty($env['env_id']['conf']['apachesolr_read_only'])) {
+          $supported = apachesolr_get_index_bundles($env['env_id'], $entity_type);
+          foreach (array_keys($info['bundles']) as $bundle) {
+            if (in_array($bundle, $supported)) {
+              $entity_info[$entity_type]['bundles'][$bundle]['apachesolr']['index'] = TRUE;
+            }
+          }
         }
       }
     }
