RediSearchEngine
extends Engine
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- createIndex() : mixed
- Create a new index with the given options.
- delete() : mixed
- Remove documents from the index.
- deleteIndex() : mixed
- Delete an index by its name.
- flush() : mixed
- Flush all of the model's records from the index.
- getTotalCount() : int
- Get the total number of results from the search query.
- lazyMap() : LazyCollection
- Retrieve lazy-mapped results.
- map() : Collection
- Map search results to Eloquent models.
- mapIds() : Collection
- Pluck and return the IDs of the given results.
- paginate() : mixed
- Paginate the given search on the engine.
- search() : mixed
- Perform the given search on the engine.
- update() : mixed
- Add or update documents in the index.
Properties
$redisStack
protected
RedisStack
$redisStack
Methods
__construct()
public
__construct(RedisStack $redisStack) : mixed
Parameters
- $redisStack : RedisStack
createIndex()
Create a new index with the given options.
public
createIndex(string $name[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $name : string
- $options : array<string|int, mixed> = []
delete()
Remove documents from the index.
public
delete(Collection $models) : mixed
Parameters
- $models : Collection
deleteIndex()
Delete an index by its name.
public
deleteIndex(string $name) : mixed
Parameters
- $name : string
flush()
Flush all of the model's records from the index.
public
flush(mixed $model) : mixed
Parameters
- $model : mixed
getTotalCount()
Get the total number of results from the search query.
public
getTotalCount(mixed $results) : int
Parameters
- $results : mixed
Return values
intlazyMap()
Retrieve lazy-mapped results.
public
lazyMap(Builder $builder, mixed $results, mixed $model) : LazyCollection
Parameters
- $builder : Builder
- $results : mixed
- $model : mixed
Return values
LazyCollectionmap()
Map search results to Eloquent models.
public
map(Builder $builder, mixed $results, mixed $model) : Collection
Parameters
- $builder : Builder
- $results : mixed
- $model : mixed
Return values
CollectionmapIds()
Pluck and return the IDs of the given results.
public
mapIds(mixed $results) : Collection
Parameters
- $results : mixed
Return values
Collectionpaginate()
Paginate the given search on the engine.
public
paginate(Builder $builder, int $perPage, int $page) : mixed
Parameters
- $builder : Builder
- $perPage : int
- $page : int
search()
Perform the given search on the engine.
public
search(Builder $builder) : mixed
Parameters
- $builder : Builder
update()
Add or update documents in the index.
public
update(Collection<string|int, Searchable> $models) : mixed
Parameters
- $models : Collection<string|int, Searchable>