Commit 02b72dcc authored by Bert Balcaen's avatar Bert Balcaen
Browse files

Making Solr respect getScoutKey().

parent 4286db36
......@@ -46,7 +46,7 @@ class SolrEngine extends Engine
{
$update = \Solr::createUpdate();
$models->each(function ($model) use (&$update) {
$update->addDeleteById($model->getKey());
$update->addDeleteById($model->getScoutKey());
});
$this->executeStatement($update);
}
......@@ -121,8 +121,9 @@ class SolrEngine extends Engine
public function mapIds($results)
{
$ids = [];
foreach ($results as $document)
$ids[] = $document->id;
foreach ($results as $document) {
$ids[] = $document->model_id;
}
return collect($ids);
}
......@@ -143,8 +144,8 @@ class SolrEngine extends Engine
$attributes[$field] = $value;
}
$eloquentResult = new $modelClass();
$eloquentResult->id = $document->id;
$eloquentResult->fill($attributes);
$eloquentResult->id = $document->model_id;
$eloquentResults[] = $eloquentResult;
}
return Collection::make($eloquentResults);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment