Skip to content

Commit

Permalink
Update scout abstract engine class abstract method list
Browse files Browse the repository at this point in the history
  • Loading branch information
ntzm authored Dec 7, 2017
1 parent f3b8369 commit 052818d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scout.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,17 @@ Once you have retrieved the results, you may display the results and render the

#### Writing The Engine

If one of the built-in Scout search engines doesn't fit your needs, you may write your own custom engine and register it with Scout. Your engine should extend the `Laravel\Scout\Engines\Engine` abstract class. This abstract class contains five methods your custom engine must implement:
If one of the built-in Scout search engines doesn't fit your needs, you may write your own custom engine and register it with Scout. Your engine should extend the `Laravel\Scout\Engines\Engine` abstract class. This abstract class contains seven methods your custom engine must implement:

use Laravel\Scout\Builder;

abstract public function update($models);
abstract public function delete($models);
abstract public function search(Builder $builder);
abstract public function paginate(Builder $builder, $perPage, $page);
abstract public function mapIds($results);
abstract public function map($results, $model);
abstract public function getTotalCount($results);

You may find it helpful to review the implementations of these methods on the `Laravel\Scout\Engines\AlgoliaEngine` class. This class will provide you with a good starting point for learning how to implement each of these methods in your own engine.

Expand Down

0 comments on commit 052818d

Please sign in to comment.