diff --git a/src/Searchable.php b/src/Searchable.php index 2da2440..48e1c9f 100644 --- a/src/Searchable.php +++ b/src/Searchable.php @@ -40,7 +40,7 @@ public function onSearchConnection(\Closure $callback) $arguments = array_slice(func_get_args(), 1); $elasticModel = clone $arguments[0]; - $elasticModel->setConnectionName(static::getElasticsearchConnectionName()); + $elasticModel->setConnection(static::getElasticsearchConnectionName()); $arguments[0] = $elasticModel;