In our monolith application that used JHIPSTER-6.10.5, we were using Spring-Data-Elastic Version: 3.3.1 with Elastic Search Version: 6.8.8. We have multiple @ManyToOne and @OneToMany relationships with over a 100+ entities.
In some cases a maximum of 7 entities are referenced from each other (I mean interlinked not just from one to other).
For elastic searching, We have been using
- To ignore indexing:
@JsonIgnoreProperities(value = { "unwanted fields" }, allowSetters = true)and@JsonIgnorewhere not needed - To map the relations: on
ManyToOne's we use@JsonBackReferencewith a corresponding@JsonManagedReferenceon the respectiveOneToManyrelationships.
Now we are in process of migration to Jhipster-7.0.1 and started seing the below problems:
- New Spring-Data-Elastic Version: 4.1.6 with Elastic Search Version: 7.9.3
- Now with Spring data elastic, the Jackson based mapper is not available we are seeing multiple StackOverflow errors. Below is the migration change we did on the annotations:
- On the relationships we have added
@Field(type = FieldType.Nested, ignoreMalformed = true, ignoreFields = {"unwanted fields"}). This stopped StackOverflow errors at Spring data level but still throw StackOverflow errors at elastic rest-client level internally. So, we are forced to use@Transientto exclude all theOnetoManyrelations. - Even on
ManyToOnerelations with the above mentioned@Fieldannotation present we are facing the elasticsearchexception with "Limit of total fields [1000] in index [] has been exceeded" - I have tried to follow the documentation on spring data, but could not resolve it.
- We have kept the Json(Jackson) Annotations also that were generated by Jhipster but they have no effect.
- On the relationships we have added
We are stalled at the moment as we are not sure how to resolve these issues; personally it was very convenient and well documented to use the Json annotations; We being new to both elastic search and spring data elastic search, started using it just for the past 8 months back, not able to figure out how to fix these errors. Please ask if i missed any information needed. I will share as much as it doesn't voilate the org policies.
Sample code Repository as requested on gitter: https://gitlab.com/thelearner214/spring-data-es-sample
Thank you in advance