I am trying to get a simple search going but for lack of examples seem to be stuck... Can anyone tell me what might be wrong here? I am getting the following error and I am not sure why...
"/Guzzle/Service/Client.php:207: Fatal Error: Method call 'setState' is not allowed for a null value. "
My source:
<?php
require 'aws-autoloader.php';
use Aws\Common\Aws;
use Aws\Common\Region;
use Aws\CloudSearch\CloudSearchClient;
use Aws\Common\Client\AbstractClient;
use Aws\Common\Client\ClientBuilder;
use Guzzle\Service\Resource\Model;
$config = array(
'key' => '<key>',
'secret' => '<secret>',
'base_url' => 'search-<searchdomain>.us-west-1.cloudsearch.amazonaws.com',
'region' => 'us-west-1'
);
$client = CloudSearchClient::factory($config);
$domainClient = $client->getDomainClient('<searchdomain>', array(
'credentials' => $client->getCredentials(),
));
$result = $domainClient ->search(array('query' => 'foo'));
$hitCount = $result->getPath('hits/found');
echo "Number of Hits: {$hitCount}
";
?>
I would appreciate any help... thank you.