"all shards failed"

I am indexing nested JSON object. The issue is when the number of fields in the object approached to 1200, it started giving the error

"all shards failed".

I have tried multiple solutions but nothing has worked so far. I have also increased the heap size to 16gb but still the issue is there.

Suggest me how can I solve it?

Please share the full error.
Please also check your Elasticsearch logs for anything relevant.

It says "type: query_shard_exception" & "reason: failed to create query: For input string "term" ".
I'm using default configuration. 1 node & 1 shard.

I have also checked the Elasticsearch logs but nothing found there.

You need to share the full error please.