dev-develop
dev-developPHP Redis search library.
MIT
The Requires
The Development Requires
dev-master
9999999-devPHP Redis search library.
MIT
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
PHP Redis search library.
Redis search layer in PHP., (*2)
Add "jesseobrien/reach": "dev-master" to the require section of your composer.json., (*3)
# Ensure your object has the searchable variables set.
class Book {
protected $searchableAttributes = ['name', 'author'];
protected $searchableNamespace = 'books';
}
// Create a new book and save it to the database.
$b = new Book();
$b->name = 'The Adventures of Sherlock Holmes';
$b->author = 'Arthur Conan Doyle';
$b->save();
// Now that our object has an id from save(), insert it into Reach
$searchIndex = new Reach();
$searchIndex->add($b);
// Search in books for 'sherlock holmes'
// Reach will return the ids of books it finds matching 'sherlock' and 'holmes'
$ids = $searchIndex->find('books', 'sherlock holmes');
$results = [];
foreach ($ids as $id)
{
$result[] = Book::find($id);
}
PHP Redis search library.
MIT
PHP Redis search library.
MIT