amazon web services - AWS CloudSearch cannot upload documents -
I'm new to AWS and CloudSearch. I have written a very simple app that is uploading a DOCX document (already using CS-import-documents to convert to JSN format) in my middle domain.
The code is very straightforward:
(above searchdomainclient = new AmazonCloudSearchDomainClient ("http: //search-xxxxx-xysjxyuxjxjxyxj.ap-southeast-2.cloudsearch. Amazonaws.com ")) using // uploaddocrequest = new UploadDocumentsRequest () {FilePath = @" c: \ temp \ testsearch.sdf ", // JSON to upload // test test docx already contains ContentType = ContentType .ApplicationJson}; Var uploadresult = searchdomainclient.upploadDocuments (uploaded doconquency); }
Although I have an exception: "Root element is missing."
Here is the JSON stuff in the SDF file that I want to upload:
"<"> "<"> "{{" type ":" add "," id ":" c : "Test", "fields": "Normal.dotm", "application_name": "Microsoft Word Word", "Paragraphfank": "1", "Resource Keymade": "TestShore DauxX", " Date: "2014-07-28 T 23: 52: 00Z", "Express_Gepice": "1", "Page_con": "1", "Publisher": "", "Producer": "John Smith", "Construction_date": "2014-07-28 T 23: 52: 00Z", "Content": "Test 5", "Author": "John Smith" "LAST_MODIFIED": "2014-07-29T04: 22: 00Z "," REVISIO "John Smith", "Character_count": "5", "character_count_with_spaces": "5", "content_type": "3", "line_count": "1", "application_version": "15.0000", "last_author" ":" Application / vnd.openxmlformats-officedocument.word processingMilka document "}}]So what's wrong in my approach?
Thanksgiving!
PS I can manually upload a docx doctor for that search and use the C # code to implement the search.
=== ========== Update 2014-08-04 == =========================
I'm not sure whether this is related to this or not in the stack trace I found it to be instead of JSON Attempts to parse XML file. But from my code I have already set ContentType = Jason, but it has no effect.
System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (String Resolution) on System.Xml.XmlTextReaderImpl.ParseDocumentContent (short) on Amazon.Runtime.International.Transform.XmlUnmarshallerContext.Read () on Amazon.timetime . Unique. Transform ARRRPS PensionsMuncherSeller In the Amazon. Unmashal (XMLMonsterShaller Contact Reference). From time to time. Built-in Transforms. Jason E.R.R.R.PS.PensionAnmashhelar In the Amanmashale (JasonEnmSherCellerContax Reference) Claude Search. Model.Internal.MarshallTransformations.UploadDocumentsResponseUnmarshaller.UnmarshallException (JsonUnmarshallerContext terms, exceptions InnerException, HttpStatusCode statusCode) Amazon.Runtime.Internal.Transform.JsonResponseUnmarshaller.UnmarshallException on (UnmarshallerContext input, exceptions InnerException, HttpStatusCode statusCode) Amazon.Runtime.AmazonWebServiceClient.HandleHttpWebErrorResponse on ( AsyncResult asyncResult, WebException we) nWebServiceClient.getResponseCallback Amazon.CloudSearchDomain.AmazonCloudSearchDomainClient.UploadDocuments (IAsyncResult result on Amazon.Runtime.Amazo) Amazon.Runtime.AmazonWebServiceClient.endOperation [T] (IAsyncResult result) at Amazon.CloudSearchDomain.AmazonCloudSearchDomainClient.EndUploadDocuments ( IAsyncResult asyncResult) (UploadDocumentsRequest request) on Amazon.CloudSearchDomain.Model.Internal.MarshallTransformat Ions.UploadDocumentsResponseUnmarshaller.UnmarshallException (JsonUnmarshallerContext Reference, Exception InnerException, HttpStatusCode statusCode)
your documents ID contains invalid characters (duration and colon). From:
The ID must be unique in all the documents uploaded to you domain and may contain the following characters: Az (lowercase letters), 0-9, and underscore character (_). The document ID must start with a letter or number and can be up to 64 characters long.
It is not even clear what you are posting, but you may also have a problem. / P>
Comments
Post a Comment