I have setup an Elasticsearch cluster on Bonsai. I am using elasticsearch-rest-high-level-client
library to read Twitter-tweets stored in Kafka and push them to the Elasticsearch index.
I getting below exception :
Exception in thread "main" ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=Limit of mapping depth [20] in index [twitter] has been exceeded due to object field [THIS CONTAINS ALL OF THE JSON MESSAGE RETRIEVED FROM KAFKA]
It seems my code is trying to put all the message as a single field. What could be going wrong?
IndexRequest indexRequest = new IndexRequest("twitter").source(jsonMessage, XContentType.JSON);
IndexResponse indexResponse = restClient.index(indexRequest, RequestOptions.DEFAULT);