1. Build a Solr powered Kalabox
A. Updating an existing Kalastack to include Solr
If you previously tried to build the box, just halt the box:
Code Block | ||
---|---|---|
| ||
$ vagrant halt |
Uncomment "include solr" in manifests/site.pp
Code Block |
---|
# initialize bonus shit
include solr
include drush
include phpmyadmin
include webgrind |
build the box with the new, local definition:
Code Block |
---|
$ export KALABOX_DEV=TRUE
$ vagrant up
$ unset KALABOX_DEV |
B. Building for the first time
Kalastack requires Vagrant 1.2.2 and VirtualBox 4.28 to be run correctly. Before you begin please download both.
Once you have downloaded and installed both Vagrant and Virtual box, you can build out the complete stack:
...
Status | ||||
---|---|---|---|---|
|
If you are building a fresh new Kalastack (not required if you use Kalabox), see the README file in the code base:
https://github.com/kalamuna/kalastack
...
+
https://github.com/kalamuna/kalastack
...
Code Block |
---|
$ vagrant plugin install vagrant-hostsupdater
$ vagrant plugin install vagrant-vbguest
$ vagrant up |
Uncomment "include solr" in manifests/site.pp
Code Block |
---|
# initialize bonus shit
include solr
include drush
include phpmyadmin
include webgrind |
build the box with local puppet definitions
Code Block |
---|
$ export KALABOX_DEV=TRUE
$ vagrant up
$ unset KALABOX_DEV |
2. Test
To ssh into your server, from within ~/kalastack, issue:
Code Block |
---|
$ vagrant ssh |
You should now be able to hit the solr admin page at http://solr.kala:8983/solr/admin/ if your /etc/hosts file is set up to point 1.3.3.7 to solr.kala solr.
To get up and running on Pantheon integration, visit this github documentation.
3. Point drupal to your local solr search environment
Kalabox provides us with a local solr instance. This is awesome. You'll initially need to set up your site to connect to this instance instead of Pantheon's.
To use our local configuration, you may need to disable the connection to Patheon's solr instance for each solr-enabled site, though kalastack 2.x should turn this off for you when you pull the DB down.
Code Block |
---|
$ drush -y dis pantheon_api |
Now, we must set the server to use our localhost and enable it at /admin/config/search/search_api/
We find the index ID of the solr index (4 here, but the number may differ for you)
Code Block |
---|
$ drush search-api-status
Id Index % Complete Indexed Total
4 my custom index 0% 0 1597 |
now we re-index the site, specifying the solr index ID (4), and the number of items to index (2000)
Code Block |
---|
$ drush search-api-index 4 2000 |
...
Code Block |
---|
$ drush search-api-status
Id Index % Complete Indexed Total
4 my custom index 100% 1597 1597 |
Resources
...
To add solr, reference https://github.com/kalamuna/kalastack/wiki/Adding-Solr-to-Kalastack
Drupal Configuration
- Enable Pantheon Solr module
- Visit `admin/config/search/pantheon_solr`
- Turn on `3.x/schema.xml` schema
- Mark for reindex with `drush @pantheon.%site%.%env% --strict=0 search-api-reindex`
- Do the indexing with `drush @pantheon.%site%.%env% --strict=0 search-api-index`