2017 © Pedro Peláez
 

library reach

PHP Redis search library.

image

jesseobrien/reach

PHP Redis search library.

  • Friday, September 26, 2014
  • by JesseObrien
  • Repository
  • 2 Watchers
  • 6 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

reach

Build Status, (*1)

Redis search layer in PHP., (*2)

Install

Add "jesseobrien/reach": "dev-master" to the require section of your composer.json., (*3)

Usage

Insert A Book

    # 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);

Find Books

    // 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);
    }

The Versions

26/09 2014

dev-develop

dev-develop

PHP Redis search library.

  Sources   Download

MIT

The Requires

 

The Development Requires

21/02 2014

dev-master

9999999-dev

PHP Redis search library.

  Sources   Download

MIT

The Requires

 

The Development Requires