I am working on a site where querying using SearchApiSolrService is successful. However, when I deploy to Acquia Cloud and attempt to access the Acquia Search using the SearchApiAcquiaSearchService I get a 403 Forbidden.


SearchApiException: "403" Status: Forbidden: Forbidden in SearchApiSolrConnection->checkResponse() (line 544 of ...sites/all/modules/contrib/search_api_solr/includes/solr_connection.inc).

The subscription information is correct (via Acquia Agent). Here's a piece of the code:

Code Sample

$server = search_api_server_load('my_acquia_solr_server');
$index = search_api_index_load('my_base_index');
$query = new SearchApiQuery($index);
$query = ... lots of random filters here that work for SearchApiSolrService calls so ignoring ...
$solr = new SearchApiAcquiaSearchService($server);
$result = $solr->search($query);


Note: If you were to replace the SearchApiAcquiaSearchService with the regular SearchApiSolrService, the non-Acquia versions of the site integrate with Solr perfectly fine.

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


The solution to this (also updated on the Drupal.org node commented above) is:

To skip this part:

$solr = new SearchApiAcquiaSearchService($server);
$result = $solr->search($query);

And simply do:

$result = $query->execute();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.