I have the following code, but I keep getting a 500 error whenever I send an index call to the client. I cannot figure out where my issue is:
require_once "../vendor/autoload.php";
use Aws\ElasticsearchService\ElasticsearchPhpHandler;
use Elasticsearch\ClientBuilder;
$handler = new ElasticsearchPhpHandler('us-west-2');
$client = ClientBuilder::create()
->setHandler($handler)
->setHosts(['https://search-arc-bis-XXXXX.us-west-2.es.amazonaws.com:443'])
->build();
$params = array();
$params['body'] = array(
'name' => 'Todd Coulson'
);
$params['index'] = 'item';
$params['type'] = 'item_books';
$client->index($params);
If I comment out the last line, no error comes up. It seems as though it could be a elasticsearch-php issue, but I cannot figure out where the issue is coming in. I am authenticating through the .aws/credentials file. Can you help me troubleshoot this?
I have the following code, but I keep getting a 500 error whenever I send an index call to the client. I cannot figure out where my issue is:
If I comment out the last line, no error comes up. It seems as though it could be a elasticsearch-php issue, but I cannot figure out where the issue is coming in. I am authenticating through the .aws/credentials file. Can you help me troubleshoot this?