Elastic Search - Unable to index large file content in a single document field

592 views Asked by At

I have created an index in elastic search. And tried to add large file content(700MB) in the document field. We know that elasticsearch will support up to 2GB maximum document can be indexed. But it throws ArgumentOutOfRangeException and the message says "Too many characters. The resulting number of bytes is larger than what can be returned as int. (Parameter 'charCount')". This exception throws before sending a request to the elastic server(at the time of constructing post data).

Find the code sample used:

 public class doc
    {
        public int id { get; set; }
        public string documentContent { get; set; }
    }
 person p = new perosn(){ id = 001, content = "700mbString Content" };//Exception source
    
 _client.Index(p,i=>i.index("indexName"));

It works up to 600MB.

Anyone suggest how to resolve this issue.

0

There are 0 answers