Document annotated classes are not being added to Elastic search context after upgrading to spring data elastic search 5.2

I am upgrading my service to springboot 3, Elastic search v8 and spring data Elasticsearch 5.2. For resolving indexes, I am using SimpleElasticsearchMappingContext to get the persistent entities currently. However, after upgrading to 5.2, the classes annotated with Document are not getting added in the mapping context. However, they do get added when I include the said class in a Repository interface. What is missing in the new version ?

Welcome!

I think you should ask this in the spring data forums.
As the problem does not seem to come from Elasticsearch in that case.