diff --git a/apachesolr.index.inc b/apachesolr.index.inc index ea7ba10..5f4c09a 100644 --- a/apachesolr.index.inc +++ b/apachesolr.index.inc @@ -130,7 +130,8 @@ function apachesolr_index_entities_document($row, $entity_type, $env_id) { apachesolr_remove_entity($env_id, $row->entity_type, $row->entity_id); } // Clear entity cache for this specific entity - entity_get_controller($row->entity_type)->resetCache(array($row->entity_id)); + //remove the reset cache + // entity_get_controller($row->entity_type)->resetCache(array($row->entity_id)); return $documents; } /** @@ -231,7 +232,12 @@ function apachesolr_index_entity_to_documents($item, $env_id) { // Entity cache will be reset at the end of the indexing algorithm, to use the cache properly whenever // the code does another entity_load + if ($entity_type == 'your_index_name'){ //mention your entity type name + $entity[] = $item; + }else{ $entity = entity_load($entity_type, array($item->entity_id)); + } $entity = $entity ? reset($entity) : FALSE; if (empty($entity)) { @@ -318,9 +324,11 @@ function apachesolr_convert_entity_to_documents($entity, $entity_type, $env_id) // Now allow modules to alter each other's additions for maximum flexibility. // Hook to allow modifications of the retrieved results - foreach (module_implements('apachesolr_index_documents_alter') as $module) { - $function = $module . '_apachesolr_index_documents_alter'; - $function($documents, $entity, $entity_type, $env_id); + if ($entity_type!='your_index_name'){ //mention your entity type name + foreach (module_implements('apachesolr_index_documents_alter') as $module) { + $function = $module . '_apachesolr_index_documents_alter'; + $function($documents, $entity, $entity_type, $env_id); + } } return $documents;