I am trying to get data from elastic search using spring reactiveElasticsearchOperations,but getting UncategorizedElasticsearchException.But I am able to see the object saved in Elastic Search successfully and when i use CURL Below is my Code.

Get From Cache:

override fun get(cacheName: String, cacheKey: String): Mono<String> {

           return reactiveElasticsearchOperations
                .get("$cacheKey", ElasticSearchData::class.java, IndexCoordinates.of(CACHE_INDEX))
                .doOnSuccess { cacheResponse ->
                    logger.info("Cache Response : $cacheResponse")
                }.flatMap { getStringFromElasticData(it) }
                .onErrorResume {
                    logger.warn { "Failed to Get Response From Cache : $cacheKey" }
                    Mono.empty()

                }
        }

data class

data class ElasticSearchData(val id: String, val timeStamp: Long, val data: String)

Update Cache Method:

override fun put(cacheName: String, cacheKey: String, cacheValue: String): Mono<Boolean> {
            val elasticSearchData =
                ElasticSearchData(id = "$cacheKey", data = cacheValue, timeStamp = Date().time)
            val result = reactiveElasticsearchOperations.save(
                elasticSearchData,
                IndexCoordinates.of(CACHE_INDEX)
            ).doOnNext { logger.info { "Updated Response in Cache Successfully for key : $it" };Mono.just(true) }
                .onErrorResume {
                    logger.warn { "Failed Update cache for key : $cacheKey" }
                    Mono.empty()
                }
            return result.flatMap { Mono.just(true) }.switchIfEmpty(Mono.just(false))
        }

output Message

org.springframework.data.elasticsearch.UncategorizedElasticsearchException: {"_index":"index","_type":"_doc","_id":"ABCD","_version":14,"_seq_no":23,"_primary_term":1,"found":true,"_source":{"_class":"com.model.ElasticSearchData","id":"ABCD","timeStamp":1599622932721,"data":"testData"}}]

Any Help Would be Appreciated

Comment From: snicoll

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.