I don't think we should switch to new SDK. However, to get the current code working with Elastic cloud we would need to modify it a bit and get few new settings on board.
Elastic Cloud SDK parses a cloud ID to build a host
/**
* Return the URL of Elastic Cloud from the Cloud ID
*/
private function parseElasticCloudId(string $cloudId): string
{
try {
list($name, $encoded) = explode(':', $cloudId);
list($uri, $uuids) = explode('$', base64_decode($encoded));
list($es,) = explode(':', $uuids);
return sprintf("https://%s.%s", $es, $uri);
} catch (Throwable $t) {
throw new Exception\CloudIdParseException(
'Cloud ID not valid'
);
}
}
To be able to call this end point you'd need to have ApiKey and pass it as a header 'Authorization: ApiKey <Replace_with_created_API_key>'
[ ] Modify settings and add API key field there
[ ] If configured use this API Key in all request to an end point as a header
[ ] Test indexing and search using Elastic cloud .
[ ] Update README
Elastic search could be hidden behind Elastic cloud APIs https://www.elastic.co/elasticsearch/
There is some docs for using PHP client https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/connecting.html
I don't think we should switch to new SDK. However, to get the current code working with Elastic cloud we would need to modify it a bit and get few new settings on board.
Elastic Cloud SDK parses a cloud ID to build a host
We don't have to do the same as host URL could be grabbed from the cloud UI console. E.g. https://7fbb410d547049028abb975dc254cfeb.eastus2.azure.elastic-cloud.com
To be able to call this end point you'd need to have ApiKey and pass it as a header
'Authorization: ApiKey <Replace_with_created_API_key>'
[ ] Modify settings and add API key field there [ ] If configured use this API Key in all request to an end point as a header [ ] Test indexing and search using Elastic cloud . [ ] Update README