hoang
hoang

Reputation: 1594

Cannot upload document into AWS CloudSearch

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

Answers (1)

macalaca
macalaca

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

Related Questions