-
Notifications
You must be signed in to change notification settings - Fork 70
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
[Feature Request] Allow programmatic (+ atomic) full reindex / import #345
Comments
Hi @apfelbox, sorry but I'm not sure I fully understand your need. Would you mind providing example of what you're trying to achieve? Thanks in advance |
Yeah, sure Often times, we have an internal importer that is importing data in an internal command. We disable automatice Doctrine-based indexing for the duration of the import (for performance reasons) and do a complete reimport afterwards. It would be great if this complete reimport could be done with just an internal service. |
@apfelbox do you mean something like what was provided in this feature? |
Not really. Right now, if I want to do a full reimport programmatically, so from my Symfony application, I have two options:
When all I want to do is class MyClass
{
public function __construct (private AlgoliaIndexer $indexer)
{
}
public function doSth ()
{
$this->indexer->reimportAtomic("my-index");
}
} All the functionality for doing a reimport is encapsulated in the console command right now, while it should be encapsulated in an internal service (class) that is then called from the console command. |
Okay! I misread your need and got confused. I see what you mean, what's happening in the -Command class could indeed be extracted in an external service. Would you feel up to submitting a PR for this? |
Description
It would be really great if you could extract the logic in
SearchImportCommand
into a separate service, so that one can easily do an atomatic full reimport programmatically. Currently you have to manually build fake CLI arguments and call the command, which is quite awkward (or copy & paste the complete code, which is just as awkward).Steps To Reproduce
n/a
The text was updated successfully, but these errors were encountered: