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']
Comment | File | Size | Author |
---|---|---|---|
#7 | 1915418_index_bundle_in_dedicated_env.d6.patch | 1.81 KB | mkalkbrenner |
#4 | 1915418_index_bundle_in_dedicated_env_4.patch | 2.47 KB | Nick_vh |
#1 | 1915418_index_bundle_in_dedicated_env.patch | 1.23 KB | mkalkbrenner |
Comments
Comment #1
mkalkbrennerComment #2
ianthomas_ukSorry, 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?
Comment #3
mkalkbrennerNot 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.
Comment #4
Nick_vhAdded more commenting, aside of that it looks ok
Comment #5
Nick_vhPushed to 7.x-1.x, needs backport
Comment #6
pwolanin CreditAttribution: pwolanin commentedpatch seems not to apply to 6.x directly
Comment #7
mkalkbrennerIn d6 we have content extra instead of entity info.
Comment #8
mkalkbrenner