简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM