Skip to content

Commit

Permalink
Fixes geerlingguy#668: Update configure-solr script for Solr 5.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy authored and oxyc committed Jun 4, 2016
1 parent 51fc897 commit 1b00d20
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions examples/scripts/configure-solr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@
SOLR_SETUP_COMPLETE_FILE=/etc/drupal_vm_solr_config_complete

# Search API Solr module.
SOLR_DOWNLOAD=http://ftp.drupal.org/files/projects/search_api_solr-8.x-1.x-dev.tar.gz
SOLR_DOWNLOAD_DIR=/tmp
SOLR_MODULE_NAME=search_api_solr
SOLR_DOWNLOAD="http://ftp.drupal.org/files/projects/search_api_solr-8.x-1.x-dev.tar.gz"
SOLR_DOWNLOAD_DIR="/tmp"
SOLR_MODULE_NAME="search_api_solr"
SOLR_VERSION="5.x"
SOLR_CORE_PATH="/var/solr/data/collection1"

# Check to see if we've already performed this setup.
if [ ! -e "$SOLR_SETUP_COMPLETE_FILE" ]; then
# Download and expand the Solr module.
wget -qO- $SOLR_DOWNLOAD | tar xvz -C $SOLR_DOWNLOAD_DIR

# Copy the Solr configuration into place over the default `collection1` core.
sudo cp -a $SOLR_DOWNLOAD_DIR/$SOLR_MODULE_NAME/solr-conf/4.x/. /var/solr/collection1/conf/
sudo cp -a $SOLR_DOWNLOAD_DIR/$SOLR_MODULE_NAME/solr-conf/$SOLR_VERSION/. $SOLR_CORE_PATH/conf/

# Adjust the autoCommit time so index changes are committed in 1s.
sudo sed -i 's/\(<maxTime>\)\([^<]*\)\(<[^>]*\)/\11000\3/g' /var/solr/collection1/conf/solrconfig.xml
sudo sed -i 's/\(<maxTime>\)\([^<]*\)\(<[^>]*\)/\11000\3/g' $SOLR_CORE_PATH/conf/solrconfig.xml

# Fix file permissions.
sudo chown -R solr:solr /var/solr/collection1/conf
sudo chown -R solr:solr $SOLR_CORE_PATH/conf

# Restart Apache Solr.
sudo service solr restart
Expand Down

0 comments on commit 1b00d20

Please sign in to comment.