Programmatically querying via SearchApiAcquiaSearchService 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.

Response

SearchApiException: "403" Status: Forbidden: Forbidden in SearchApiSolrConnection-&gt;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-&gt;search($query);


Thoughts?

Note: If you were to replace the SearchApiAcquiaSearchService with the regular SearchApiSolrService, the non-Acquia versions of the site integrate with Solr perfectly fine.
The solution to this (also updated on the Drupal.org node commented above) is:

To skip this part:

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


And simply do:

$result = $query-&gt;execute();