Closed tkhill-AWS closed 9 months ago
Here is the UploadDocument API details for the PHP SDK.
It seems to me that the trouble here is not PHP or even SDK related. The call to batch upload documents is trivial, but the formatting of the JSON/XML files is not well laid out in the SDK references. https://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html#creating-document-batches has a good example of how to format it. Once that is done, the call to the SDK is only:
$result = $client->uploadDocuments([ 'contentType' => 'application/json', //or 'application/xml' 'documents' => $jsonFormattedString, //or $xmlFormattedString ]);
Background story
A PHP SDK user wants an example of how to upload documents for indexing to the CloudSearch service.
Currently no CloudSearch SOS examples exist (for any SDK). Any examples for bulk uploads exist in the CloudSearch developer guide. The examples described there are for the console, CLI and direct HTTP.
What does this example accomplish?
See Background story.
Which AWS service(s)?
CloudSearch
Which AWS SDKs or tools?
Are there existing code examples to leverage?
maybe: https://docs.aws.amazon.com/cloudsearch/latest/developerguide/submitting-doc-requests.html
Do you have any reference code?