Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to delete an object from index only having an identifier #130

Open
norkunas opened this issue Nov 23, 2021 · 3 comments
Open

Allow to delete an object from index only having an identifier #130

norkunas opened this issue Nov 23, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@norkunas
Copy link
Collaborator

Description
Currently MeiliSearch\Bundle\SearchService exports method for deleting an entity, but there is no way to delete it having an identifier only. The basic use case - delete hundreds of entities in batch, then dispatch a messenger message to remove them from index, but providing only integers, as you cannot load anymore entities that do not exist.

Basic example

public function removeById(ObjectManager $objectManager, $identifier); // not sure about typehint of $identifier

Other

nothing more.

@curquiza
Copy link
Member

Hello @norkunas, feel free to implement your need in this package :)

We should have test for this function of course

@norkunas
Copy link
Collaborator Author

Looking at how the final ID is generated to be stored to meilisearch, I'm not sure how this could work with composite identifiers..

For a basic use case when no composite is used, we could allow to just pass int/string ID and then in the method retrieve the identifier field of the doctrine entity and convert to the meilisearch format and that would work.

But if composite would be used than we'd need to manually provide the values mapping to which fields they belong and also in the same order that is retrieved to convert the composite..

Maybe a basic use case would be enough for now until someone would show an interest?

@curquiza
Copy link
Member

Maybe a basic use case would be enough for now until someone would show an interest?

Yes, let's keep basic for a first implementation.

@brunoocasali brunoocasali added the enhancement New feature or request label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants