pantheon-systems / search_api_pantheon

ApachSolr on Pantheon for Drupal 8/9 via Search API
https://pantheon.io
MIT License
7 stars 24 forks source link

Documentation for .envrc.dist #181

Open kristin-wiseman opened 3 months ago

kristin-wiseman commented 3 months ago

Is your feature request related to a problem? Please describe. I'm trying to set up a local development environment for a Drupal 10 site hosted on Pantheon using Solr. I'm using DDEV with the ddev-drupal-solr add on, and I've copied .envrc.dist into .ddev/.env . I've set the values according to the provided examples, but I'm still getting a warning message that the server is reachable but the core is not. I've tried setting PANTHEON_INDEX_CORE to both the core's name as well as its path, but neither work, and it's unclear what that variable expects.

Also, there's no example for a PANTHEON_INDEX_SCHEMA variable, but I've found that setting one that matches the schema on the site on Pantheon removes the warning in the status report that says "This module only works when it is on a Pantheon environment or the environment variables are correctly set as described in .envrc.dist".

Describe the solution you'd like Documentation within .envrc.dist that lists every variable necessary for the module to function in a local development environment. Also, comments for at least the PANTHEON_INDEX_HOST and PANTHEON_INDEX_CORE variables that describe the variable and demonstrate the expected format.

Describe alternatives you've considered I've considered using a configuration split specifically for DDEV with a separate search server connected to the index. However, Search API Pantheon seems to prevent that server from working despite using the Standard Solr connector, and disabling it causes problems when switching between environments locally to export configuration.

stevector commented 2 months ago

I was just on office hours with @kristin-wiseman trying to work though this

Setting environment variables of

export PANTHEON_INDEX_HOST=${DDEV_HOSTNAME}
export PANTHEON_INDEX_PORT=8983
export PANTHEON_INDEX_PATH=/solr
export PANTHEON_INDEX_CORE="dev"
export PANTHEON_INDEX_SCHEME=http

We could get a message that Solr was reachable but not the core.

Screenshot 2024-07-17 at 3 14 11 PM

Within the Pantheon Multidev we were checking against we saw that the Multidev had an absolute path for PANTHEON_INDEX_CORE (/site/5f6a069b-e1e9-4c62-8606-d26c1038b080/environment/july2024) but when we tried a similar absolute value from DDev (/var/solr/data/dev) we got the White Screen of Death

Screenshot 2024-07-17 at 3 16 54 PM
bsnodgrass commented 2 months ago

Thanks for looking at this with us @stevector! We will take more time to investigate ourselves and post any further details from our investigation.

damienmckenna commented 2 months ago

Due to how certain modules work, IMHO the best approach to working with Solr is to define a single server configuration and override it locally for ddev etc. Having multiple servers leads to needing to overriding the index(es), or having multiple indexes which gets even messier (multiple facets, multiple block definitions, multiple hook implementations, etc, etc).

What I've typically done is:

At that point everything works pretty smoothly.