Commit 2beb01fc authored by Bert Balcaen's avatar Bert Balcaen
Browse files

Using bufferedadd for updates.

parent 0da36f81
......@@ -16,13 +16,12 @@ class SolrEngine extends Engine
*/
public function update($models)
{
$update = \Solr::createUpdate();
$models->each(function ($model) use (&$update) {
$searchableArray = $model->toSearchableArray();
$document = $update->createDocument($searchableArray);
$update->addDocument($document);
});
$this->executeStatement($update);
$buffer = \Solr::getPlugin('bufferedadd');
$models->each(function ($model) use (&$buffer) {
$searchableArray = $model->toSearchableArray();
$document = $buffer->createDocument($searchableArray);
});
$buffer->flush();
}
/**
......
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