Closed sk33wiff closed 2 years ago
Hey @marcelopm, what ES version do you use? I can surely do it, but only in the new version 4.0
, which only supports ES8. I'm not planning to support the previous version due to a lack of time.
Side note: have you considered creating a custom MakeSearchable
job and then replacing the default one in the service provider?
function boot()
{
Scout::$makeSearchableJob = MyMakeSearchable::class;
}
That's great, thanks for considering it @babenkoivan
We do that already. As part of the solution we came up with, we created a custom MakeSearchable
job and overridden the handle() method so that we can pass the current job instance to the update method, as below:
$this
->models
->first()
->searchableUsing()
->update($this->models, $this);
We created also other job classes that extends it.
This allow us to dispatch specific MakeSearchable alike jobs and, more importantly, decide how we want to handle them during (re)indexing of models' data, as mentioned initially.
Hi @marcelopm, just FYI: Engine
is now non-final since v4.0.2.
We are migrating from the old driver, where we managed to prioritize the indexing of models' data according to their size by creating a custom Indexer and use it instead of the Simple or Bulk indexers that comes out of the box with that driver.
We need to refactor our solution into something that can be used with the new ecosystem, which this driver is part of.
Reasons why we want to be able to overwrite ElasticScoutDriverPlus\Engine::update()
UPDATE: we know we can work around this by using a Decorator, but we'd like to avoid it if possible.