Closed furioursus closed 10 months ago
I’ll also add that if an entry will not save to the index with that error, I can save it as a new entry in Craft and the new entry will push to the index without a problem!
I’m also happy to provide our affected db if you need to troubleshoot at any point.
So what's happening is here:
https://github.com/riasvdv/craft-scout/blob/master/src/jobs/MakeSearchable.php#L34
$engine
can apparently come back as null
. Without looking deeply into why, or whether that's by design, a simple fix we can probably do is change the execute()
function to be:
public function execute($queue)
{
if (!$element = $this->getElement()) {
return;
}
$engine = $element->searchableUsing()->first(function (Engine $engine) {
return $engine->scoutIndex->indexName === $this->indexName;
});
// Handle $engine coming back as null as per: https://github.com/riasvdv/craft-scout/issues/121 -- aaw/2020.01.02
if (!$engine) {
return;
}
$engine->update($element);
if ($this->propagate) {
$element->searchableRelations();
}
}
I can do a PR if you're still around @riasvdv -- probably just as easy for you to apply the fix tho, if you're up for it.
I'm so sorry, completely lost track of this issue, I've added this fix in 2.1.4
I’m running the latest version of Scout (2.1.2) and Craft (3.3.15). If I submit my indices from the command line, they all process as normal and things seem to work just fine.
However, I find that some of my entries will fail when the authors attempt to update their entry in the control panel with the following stacktrace in
queue.log
:In this example, I have disabled literally every field, facet, etc., in the index setup as shown here and flushed all the old settings
dev_news
which this should post to:I'm a bit stymied about how to proceed. I can alleviate the problem when it arises by updating the indices from the command line, and things work as normal, but that incurs a HUGE overhead of operations as the process touches literally every other section's index on the site.
Is there anything I might be missing here that needs to be set or declared?