Acquia Search is a module within https://drupal.org/project/acquia_connector used on sites hosted at the Aquia Cloud.
By default, all environments except production will perform searches on Aquia's Solr instance in Read Only mode.
There are a few gotchas in setting a Solr Server locally when using aquia_search. Here is a step by step guide:
- Download and start Solr locally.
- Set
$conf['apachesolr_read_only']
to 0 at settings.php. Otherwise content won't be indexed. Note remember to unset this once you are done or you may possibly alter production's Solr index. - Go to admin/config/search/apachesolr/settings and clone
Acquia Search
environment. - Run the following query to change the class that
local
uses to run Solr queries:
update apachesolr_environment set service_class = 'DrupalApacheSolrService', url = 'http://localhost:8983/solr' where env_id = 'acquia_search_server_1_0';
- Go to admin/config/search/apachesolr/settings/acquia_search_server_1_0 and verify that Drupal can connect to your local solr instance.
- Go to admin/config/search/apachesolr/settings/acquia_search_server_1_0/index and mark the content types that you want to index.
- Run the following commands to start indexing:
# Note you can also run cron but that will take longer and index just a bunch of nodes.
drush solr-delete-index
drush -v solr-index
- Search for anything, you should start seeing log messages at the terminal where your Solr server is running.If you ever need to debug Solr locally, these steps should help you to get set up.
If you want to verify what is being sent to Apache Solr when indexing, set a breakpoint on apachesolr_cron(), start your debugger and perform a search on your local environment.
The acquia_search module uses a custom class to perform queries to
Solr. Set a breakpoint at Acquia_Search_Service->_sendRawGet()
and debug a search in
order to see what is being sent and returned by Solr.
You might want to check out the config overrides that you can place in your settings.php file if we talk about Drupal 8 and Search API Server override it gonna look like this:
Note: That in UI you will not gonna see these overiden changes due to a D8 bug, so you can see it via following drush command:
drush cget search_api.server.acquia_search_server --include-overridden