LOCAL DEVELOPMENT - pantheon-systems/search_api_pantheon GitHub Wiki

Home | Best Practices | Fun With Indices | Installation | Jargon | Local Development | Processors | Troubleshooting Indices

Requirements

Setup

# Export a demo sitename to make life easier.
export SITENAME=${USER}-solr8-demo
# Now whenever you use the variable <code>${SITENAME}</code> the name above will be automagically supplied.

# Create a new site sandbox that we will use for this demo.
# If you have not used Terminus in more than 24 hours you may
# need to <code>terminus auth:login</code>
terminus site:create ${SITENAME} ${SITENAME} drupal9

# Do a standard Drupal 9 site install of the UMAMI demo site
terminus drush ${SITENAME}.dev -- site:install --account-name=admin --site-name=${SITENAME} --locale=en --yes demo_umami

# Change the site's development mode to GIT
terminus connection:set ${SITENAME}.dev git

#Enable Solr searching for the site
terminus solr:enable ${SITENAME}

# Clone the site to your pantheon-local-copies folder
terminus local:clone ${SITENAME}

# Go to the directory where the site was cloned
cd ~/pantheon-local-copies/${SITENAME}

# Require <code>SEARCH_API_PANTHEON</code> and supporting modules
composer require -W  \
   drupal/devel \
   drupal/search_api_spellcheck \
   drupal/search_api_autocomplete \
   drupal/search_api_page \
   pantheon-systems/search_api_pantheon:^8

# Add the following line to the <code>pantheon.yml</code> file
# in the root directory. making sure there are four
# and only four spaces in front of the word <code>version</code>.
# Yaml files are very sensitive to spacing and indention.
echo "search:\n    version: 8" >> pantheon.yml

# Commit and Push all the changes from the current directory to pantheon.
git add composer.* pantheon.* && git commit -m 'updating pantheon.yml and composer.json' && git push origin master

# Commune with the DemiGods
terminus demigod:copy-templates ${SITENAME}

# Verify environment vars
env | grep DRUPAL
# You should see several <code>DRUPAL_*</code> variables set in your environment. Direnv allows you to set environment
# variables based on being in a specific directory. If these variables are not present, the docker integration
# will not work.

# Start up the docker instance(s)
robo docker:up

# Pull the database from the Pantheon DEV environment.
robo site:pull-database dev

# Pull the files from the Pantheon DEV environment.
robo site:pull-files dev

# Enable development modules in drupal
robo site:development-mods
# Enables the following modules: <code>devel</code>, <code>search_api</code>, <code>search_api_solr</code>, <code>search_api_solr_admin</code>, <code>search_api_solr_devel</code>, <code>search_api_pantheon</code>, <code>search_api_spellcheck</code>, <code>search_api_page</code>, <code>search_api_pantheon_admin</code>, <code>search_api_autocomplete</code>

# Get a one-time login link
robo site:login

# You will get a URL. Copy-pasting that URL into your browser will get you logged in on the local server.
⚠️ **GitHub.com Fallback** ⚠️