It would be very useful to be able to set e.g. search pages to use 'default' environment, instead of explicit value. E.g. quite usual scenario is local development on Drupal VM, where the environment ID is 'solr' and then deploying to Acquia, where the environment ID is 'acquia_search_server_1'. While we have this value set dynamically in settings.php per environment $conf['apachesolr_default_environment'] = 'acquia_search_server_1';, it's still exported into Features as explicit value. Better option would be to have 'default' when creating e.g. search pages or blocks, which would always use current Solr seach.

The way I propose to accomplish this is:

  • Alter the search page settings and add 'default' option for the environment ID dropdown, so string 'default' is saved to the database. That way the exported Feature will be universal (not overridden) across multiple environments which use different Solr cores.
  • Modify function that loads the search pages, in order to replace 'default' with actual current Solr env. ID. That way no other dependant logic in the application has to be changed. In this step I would also add a flag (e.g. in the settings array) to indicated that the page uses default env. ID for further reference.
  • Alter block pages which use similar environment ID dropdown as the search page settings page.

Links:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

david.lukac created an issue. See original summary.

david.lukac’s picture

Issue summary: View changes
Status: Active » Needs work
david.lukac’s picture

Issue summary: View changes
david.lukac’s picture

The work I proposed above is being done in HitHub repo: davidlukac/apachesolr - GitHub.

david.lukac’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
4.97 KB

Supplying first patch to implement what's been drafted above.

Status: Needs review » Needs work

The last submitted patch, 5: exporting_solr_settings-2572211-5.diff, failed testing.

david.lukac’s picture

Patch failed due to "NEW" PHP array syntax - see issue on GitHub . I will supply new one soon.

alexmoreno’s picture

I'm not sure there is the need of this code, there is already a way of doing this:

https://docs.acquia.com/acquia-search/multiple-cores/override

Kolin’s picture