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']

#7 1915418_index_bundle_in_dedicated_env.d6.patch1.81 KBmkalkbrenner
None View
#4 1915418_index_bundle_in_dedicated_env_4.patch2.47 KBNick_vh
PASSED: [[SimpleTest]]: [MySQL] 513 pass(es). View
#1 1915418_index_bundle_in_dedicated_env.patch1.23 KBmkalkbrenner
PASSED: [[SimpleTest]]: [MySQL] 513 pass(es). View


mkalkbrenner’s picture

Status: Active » Needs review
1.23 KB
PASSED: [[SimpleTest]]: [MySQL] 513 pass(es). View
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

2.47 KB
PASSED: [[SimpleTest]]: [MySQL] 513 pass(es). View

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
1.81 KB
None View

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.