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
Description
Right now, SearchEntityhas a fixed method to generate the objectID from doctrine's primary key. The problem is that objectIDs are limited in what characters they can contain (e.g. : is disallowed) - so this limits what values can be used in the Doctrine's entity fields if the entity has to be indexable/searchable.
We need a possibility to override/customize this method in order to map entity data to acceptable objectID.
Basic example
In our case we have CustomerAccount entity, which has a composite primary key made of two columns 'context' and 'account_id'. However, account_ids sometimes contain : character, which is not allowed in ObjectID, so these entities fail to to be indexed.
Other
There are multiple ways how this could be addressed, here's a few rough ideas:
Introduce IdNormalizerInterface so that custom service can be implemented and then it would be used to generate the id for the SearchEntity
Allow configuration to tell which entity getter should be called to get the objectID for it
Generally make the current method cleanup the value to be compatible with the engine requirements (as long as ObjectID is never used for mapping back to the entity). Or it could use even use a hash function for objectID (and include the raw values as attributes)
The text was updated successfully, but these errors were encountered:
We might not have enough time to work on it in the following weeks. Also, I will add some details to this issue to make the implementation easier. If someone wants to contribute and implement it, it will be released faster! PRs are always welcome!
Also, there is some related issues to this topic: #66 and #58
I see Aggregator model (which is then extended by Aggregator Entity and Document) has similar logic (mapping entity to object ID and back) - maybe that the way to go, and make it equally apply to all Entities, not only those extending Aggregator (extending somehow doesn't sound right at this point in general)?
Although to me it still feels that an external service (like Normalizer/Denormalizer) would be the cleanest solution.
And from those other threads - did I get it right, there is a desire to completely get rid of objectID field? Or just how it is produced/used? Or just the naming?
Description
Right now,
SearchEntity
has a fixed method to generate the objectID from doctrine's primary key. The problem is that objectIDs are limited in what characters they can contain (e.g.:
is disallowed) - so this limits what values can be used in the Doctrine's entity fields if the entity has to be indexable/searchable.We need a possibility to override/customize this method in order to map entity data to acceptable objectID.
Basic example
In our case we have CustomerAccount entity, which has a composite primary key made of two columns 'context' and 'account_id'. However, account_ids sometimes contain
:
character, which is not allowed in ObjectID, so these entities fail to to be indexed.Other
There are multiple ways how this could be addressed, here's a few rough ideas:
IdNormalizerInterface
so that custom service can be implemented and then it would be used to generate the id for theSearchEntity
The text was updated successfully, but these errors were encountered: