Engine
abstract class Engine
Abstract base class for search engine implementations.
Engines handle the actual indexing and searching operations with external search services like Meilisearch, or in-memory for testing.
Methods
Pluck and return the primary keys of the given results.
Get the total count from a raw result returned by the engine.
Create a search index.
Delete a search index.
Pluck and return the primary keys of the given results using the given key name.
Details
at line 27
abstract void
update(Collection $models)
Update the given models in the search index.
at line 34
abstract void
delete(Collection $models)
Remove the given models from the search index.
at line 39
abstract mixed
search(Builder $builder)
Perform a search against the engine.
at line 44
abstract mixed
paginate(Builder $builder, int $perPage, int $page)
Perform a paginated search against the engine.
at line 49
abstract Collection
mapIds(mixed $results)
Pluck and return the primary keys of the given results.
at line 56
abstract Collection
map(Builder $builder, mixed $results, Model $model)
Map the given results to instances of the given model.
at line 63
abstract LazyCollection
lazyMap(Builder $builder, mixed $results, Model $model)
Map the given results to instances of the given model via a lazy collection.
at line 68
abstract int
getTotalCount(mixed $results)
Get the total count from a raw result returned by the engine.
at line 75
abstract void
flush(Model $model)
Flush all of the model's records from the engine.
at line 80
abstract mixed
createIndex(string $name, array $options = [])
Create a search index.
at line 85
abstract mixed
deleteIndex(string $name)
Delete a search index.
at line 90
Collection
mapIdsFrom(mixed $results, string $key)
Pluck and return the primary keys of the given results using the given key name.
at line 98
Collection
keys(Builder $builder)
Get the results of the query as a Collection of primary keys.
at line 106
Collection
get(Builder $builder)
Get the results of the given query mapped onto models.
at line 118
LazyCollection
cursor(Builder $builder)
Get a lazy collection for the given query mapped onto models.