Commit e788e6d1 authored by Bert Balcaen's avatar Bert Balcaen
Browse files

Fixing Scout compat.

parent 402ff79c
......@@ -120,11 +120,12 @@ class SolrEngine extends Engine
/**
* Map the given results to instances of the given model.
*
* @param \Solarium\QueryType\Select\Result\Result $results
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Laravel\Scout\Builder $builder
* @param mixed $results
* @param \Illuminate\Database\Eloquent\Model $model
* @return \Illuminate\Database\Eloquent\Collection
*/
public function map($results, $model)
public function map(Builder $builder, $results, $model)
{
$eloquentResults = [];
$modelClass = get_class($model);
......@@ -151,4 +152,18 @@ class SolrEngine extends Engine
{
return $results->getNumFound();
}
/**
* Flush all of the model's records from the engine.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return void
*/
public function flush($model)
{
$update = \Solr::createUpdate();
$update->addDeleteQuery('model_class_name:' . get_class($model));
$this->executeStatement($update);
}
}
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