Reputation: 1594
I'm using AWS CloudSearch SDK Java (aws-java-sdk-cloudsearch 1.11.288)to upload document to CloudSearch. But it throws this exception:
AmazonCloudSearchDomainException: null (Service: AmazonCloudSearchDomain; Status Code: 411; Error Code: null...
Still not find the solution for that issue. I can upload the same json data using AWS Cloudsearch CLI. How can I get over this exception?
Thanks.
Upvotes: 0
Views: 305
Reputation: 1048
The AWS documentation says that a request to upload documents will receive a response with the 411 status code when it is missing the Content-Length header.
Make sure to set the content length by calling the setContentLength() method on the UploadDocumentsRequest object with the appropriate value for your request.
Upvotes: 1