Skip to content

Commit

Permalink
Add compatibility with Scout 9
Browse files Browse the repository at this point in the history
  • Loading branch information
msassa committed Sep 5, 2022
1 parent d6c96ef commit 2ea1e69
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions src/Engines/ElasticEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
}
}

0 comments on commit 2ea1e69

Please sign in to comment.