Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sometimes it is useful to connect to more than one subscription. We should follow the progress of #1190890: Support multiple search environments for the same AN subscription and port the changes to this module as well.
Comment | File | Size | Author |
---|---|---|---|
#8 | alternate-subscription-1689778-8.patch | 5.12 KB | cpliakas |
#1 | search_api_acquia-persistent-variable-config-path-switch-1689778-1.patch | 2.15 KB | alanmackenzie |
Comments
Comment #1
alanmackenzie CreditAttribution: alanmackenzie commentedWhat's missing from this now is the ability to switch the solr path based on environment.
If you rely on the DB & features you can get into a painful mess of having to do manual configuration on each environment and developers accidentally make changes to the wrong index.
The apachsolr module uses the
apachesolr_path
persistent variable to allow for switching of the path through $conf[].The attached patch follows the same pattern, only with the variable name
search_api_acquia_path
.Example of how to use it:
There's a fair argument that this should be implemented in search_api_solr instead, however this module is implementing
connect()
inSearchApiAcquiaSearchService
so it's not possible to use the layer below. It's not obbious to me why this is as the code in the method is exactly the same.If you want me to push this upstream instead and you can confirm that it's ok to remove the implementation of
connect()
I can provide patches to remove it and reimplement this change againstsearch_api_solr
.Comment #2
nielsvm CreditAttribution: nielsvm commentedI've pinged various people on your behalf Alan!
(Acquia support reference #73024).
Comment #3
Nick_vhWhy not use the same variables as apachesolr to make it easier and more consistent?
Comment #4
Nick_vhOn that note, this module should support the hostname that is pulled in from the subscription array.
Something similar like this.
Comment #5
Nick_vhComment #6
cpliakas CreditAttribution: cpliakas commentedMarking as a critical task for the following reasons:
Comment #7
cpliakas CreditAttribution: cpliakas commented@alanmackenzie, thanks for your contribution!
Comment #8
cpliakas CreditAttribution: cpliakas commentedThe attached patch implements Nick's suggestions in #4 to achieve alanmackenzie's goals of using settings.php to change the subscription based on environment. It also implements Nick's suggestion to use the hostname pulled from the subscription. As a bonus, I added the "search_api_acquia_overrides" variable which allows you to override the options on a per-server basis for all servers connected to Acquia Search.
Comment #9
Nick_vhLooks good to go
Comment #10
cpliakas CreditAttribution: cpliakas commentedExcellent. Thanks for reviewing!
Comment #11
cpliakas CreditAttribution: cpliakas commentedResolved in commit http://drupalcode.org/project/search_api_acquia.git/commit/944b168.
Comment #12
alanmackenzie CreditAttribution: alanmackenzie commentedThanks for the speedy response guys.
Can you confirm that
$subscription['heartbeat_data']['search_service_colony'];
isn't some form of high availability failover (as the name heartbeat suggests)?If it was I would expect it to override
search_api_acquia_overrides
, I can provide another patch if so.Comment #13
cpliakas CreditAttribution: cpliakas commentedHi @alanmackenzie.
I believe that this setting is not related to the HA heartbeat software but something else that is deprecated. Regardless, I am confident that it has nothing to do with the HA of search as that is managed server-side on Acquia's infrastructure.
Thanks,
Chris