diff --git a/src/Engines/ElasticEngine.php b/src/Engines/ElasticEngine.php index ffd4eaa..ca76b06 100644 --- a/src/Engines/ElasticEngine.php +++ b/src/Engines/ElasticEngine.php @@ -195,11 +195,11 @@ public function getTotalCount($results) * @param $index * @return void */ - public function createIndex($index, $map_file) + public function createIndex($name, array $options = []) { - $mapping = json_decode(file_get_contents(database_path($map_file)), true); + $mapping = json_decode(file_get_contents(database_path($options['map_file'])), true); $params = [ - 'index' => $index, + 'index' => $name, 'body' => $mapping ]; return $this->elastic->indices()->create($params); @@ -384,4 +384,27 @@ function ($order) { } )->toArray(); } + + + /** + * Map the given results to instances of the given model via a lazy collection. + * + * @param Builder $builder + * @param mixed $results + * @param Model $model + * + * @return \Illuminate\Support\LazyCollection + */ + function lazyMap(Builder $builder, $results, $model) { + } + + /** + * Delete a search index. + * + * @param string $name + * + * @return mixed + */ + function deleteIndex($name) { + } }