Allow to decorate ElasticSearch CriteriaParser so we can have custom parsing
We are implementing service products, which are products for which you pay in intervals (for example monthly) and don't have to be physical products (like a mobile phone subscription).
For this we also have a cheapest initial recurring price on these products, similar to the cheapest price of products.
We successfully mimicked the logic to update these fields both in the database as well as in ElasticSearch.
However we also need a custom CriteriaParser to parse these fields. We can do this by decorating the CriteriaParser and implementing all public methods, however this is not ideal currently:
- There is no abstract CriteriaParser class so we need to extend the class itself, which is a bit weird if you also decorate it.
- Properties and methods (like isCheapestPriceField, getCheapestPriceParameters and getCheapestPriceAccessors) are private, meaning we can't use them in our logic and have to reimplement things similar to it.
- The class is marked internal, so what we are doing can break any moment.
It would be nice if there is official support for such a use case.