Install Solr core for drupal🔗

https://git.drupalcode.org/project/search_api_solr/-/blob/8.x-3.x/INSTALL.md#setting-up-solr-single-core

You can also copy from other core configs (/opt/solr/server/solr/$CORE/conf)

  1. Make sure you have installed the newest solr and oracle's Java.
  2. Make sure /opt/solr-VERSION is owned by solr (chown -R solr:solr /opt/solr_VERSION)
  3. Make sure solr is started, or else core creation will not work: bin/solr start
  4. Go to your drupal site and make sure the Search API Solr module is installed.
  5. Click add server if there is no server.
  6. Give it a name
  7. Backend : solr
  8. Standard should do
  9. Solr node: localhost
  10. Solr port: 8983
  11. Solr collection: The name of the core you're about to make
  12. Run this command:
cd /path/to/drupal
mkdir -p /tmp/config/ && drush solr-gsc [NAME-OF-SERVER-YOU-CREATED-IN-DRUPAL] /tmp/config/config.zip [SOLR-VERSION] && cd /tmp/config && unzip config.zip
  1. Create core:
sudo -u solr /opt/solr/bin/solr create_core -c [CORE-NAME] -d /tmp/config -n [CORE-NAME]