You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all thank you so much for providing this awesome package! It made integrating our service with elastic a breeze!
However, at the moment I am looking for an elegant solution storing slightly modified copies of my entity in elastic search without having to define all the properties by hand.
But first some context: I have a rest service that provides product information. The main entity I am dealing with, is Product which in itself consists of numerous other related entites. Since these Product entities tend to be rather big in the end, I have decided not to return all of it as part of the response to requests to the service. Besides that I have created a DTO that contains both a subset of data that I have in the entity as well as some "computed" values based on what I have stored in other fields within the entity. Upon request the entity gets loaded, send through a custom converter class that maps the entity values to the one in the dto. Then the DTO gets serialized with JMS and returned as response. This logic already existed before I introduced Elastic (and fosElasticaBundle) to the stack.
What I want to do now is to apply the logic (entity -> converter -> model) before storing anything in elastic. This would speed up requests, since I can return the result completely from elastic. Question is: how can I hook into the ModelToElastic Transformation process provided by fosElasticaBundle and swap out the entity for the DTO and leverage my already existing serialization information before sending things off to Elastic?
Here's my current foselastica config for reference:
Hi,
first of all thank you so much for providing this awesome package! It made integrating our service with elastic a breeze!
However, at the moment I am looking for an elegant solution storing slightly modified copies of my entity in elastic search without having to define all the properties by hand.
But first some context: I have a rest service that provides product information. The main entity I am dealing with, is
Product
which in itself consists of numerous other related entites. Since theseProduct
entities tend to be rather big in the end, I have decided not to return all of it as part of the response to requests to the service. Besides that I have created a DTO that contains both a subset of data that I have in the entity as well as some "computed" values based on what I have stored in other fields within the entity. Upon request the entity gets loaded, send through a custom converter class that maps the entity values to the one in the dto. Then the DTO gets serialized with JMS and returned as response. This logic already existed before I introduced Elastic (and fosElasticaBundle) to the stack.What I want to do now is to apply the logic (entity -> converter -> model) before storing anything in elastic. This would speed up requests, since I can return the result completely from elastic. Question is: how can I hook into the ModelToElastic Transformation process provided by fosElasticaBundle and swap out the entity for the DTO and leverage my already existing serialization information before sending things off to Elastic?
Here's my current foselastica config for reference:
Up to now I tried two things:
How would you tackle this? Thanks!
The text was updated successfully, but these errors were encountered: