Most of the code is written to handle different indexes, using so called environments.
The main indexing loop in function apachesolr_index_entities($env_id, $limit) perfectly deals with different environments as well.
It's possible to index different entities or bundles in different indexes / environments.

But as soon you remove a node bundle from the default environment, the bundle could not be index in any environment anymore.

The problem is that apachesolr_entity_info_alter() only cares about the default environment when setting $entity_info[$entity_type]['bundles'][$bundle]['apachesolr']['index'] to TRUE.

I created a patch that considers all writable environments for the value of $entity_info[$entity_type]['bundles'][$bundle]['apachesolr']['index']

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mkalkbrenner’s picture

Status: Active » Needs review
FileSize
1.23 KB
ianthomas_uk’s picture

Sorry, I've only got time to look at this in passing, but won't that mark a bundle for indexing on all environments? What if you want to index one bundle on one environment, and another on a different environment?

mkalkbrenner’s picture

won't that mark a bundle for indexing on all environments?

Not exactly. It checks if a modified entity of a bundle needs to enqueued because it's indexed in any environment.

If you have a look at #1915614: Complete admin settings for non-default environments as well, you'll see that every environment then picks up the right entities.

Nick_vh’s picture

Added more commenting, aside of that it looks ok

Nick_vh’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Pushed to 7.x-1.x, needs backport

pwolanin’s picture

patch seems not to apply to 6.x directly

mkalkbrenner’s picture

Issue summary: View changes
Status: Patch (to be ported) » Needs review
FileSize
1.81 KB

In d6 we have content extra instead of entity info.

mkalkbrenner’s picture

Status: Needs review » Fixed

  • mkalkbrenner committed 53e9897 on 6.x-3.x
    Issue #1915418 by mkalkbrenner: Unable to index a node bundle in a...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.