In SolrResultSet::getDataObjects line 196 Objects that are in the Solr result, that are not found in the SilverStripe Database are supposed to be removed.
But the call to SolrSearchService::unindex is wrong. unindex expects only one parameter $typeOrId.
We can't simply pass the $ID since unindex would prefix that with the RAW_DATA_KEY.
As a Hack I changed:
$this->solr->unindex($type, $id);
to
$removedObject = new $type;
$removedObject->ID = $id;
$this->solr->unindex($removedObject);
That seems to work. I could not test this with the current master branch, since we run on a fork from an older version. But from reading the code, I''m certain the problem still exists in the current version.
In SolrResultSet::getDataObjects line 196 Objects that are in the Solr result, that are not found in the SilverStripe Database are supposed to be removed. But the call to SolrSearchService::unindex is wrong. unindex expects only one parameter $typeOrId.
We can't simply pass the $ID since unindex would prefix that with the RAW_DATA_KEY.
As a Hack I changed:
to
That seems to work. I could not test this with the current master branch, since we run on a fork from an older version. But from reading the code, I''m certain the problem still exists in the current version.