sgrodzicki/algoliasearch-api-client

Algolia Search API Client for PHP

1.0.0 2013-08-14 23:50 UTC

This package is not auto-updated.

Last update: 2024-11-04 15:36:07 UTC


README

Build Status

This PHP client let you easily use the Algolia Search API from your backend.

Installation

The Algolia Search API Client is available on Packagist and as such installable via Composer.

If you do not use Composer, you can grab the code from GitHub, and use any PSR-0 compatible autoloader (e.g. the Symfony2 ClassLoader component) to load the library's classes.

Composer example

Add "sgrodzicki/algoliasearch-api-client" in your composer.json:

{
    "require": {
        "sgrodzicki/algoliasearch-api-client": "1.0.*"
    }
}

Download the library:

$ php composer.phar update sgrodzicki/algoliasearch-api-client

After installing, you need to require Composer's autoloader somewhere in your code:

require_once 'vendor/autoload.php';

Usage

use Algolia\SearchApiClient\Client\AlgoliaSearchClient;

$client  = AlgoliaSearchClient::factory(array(
    'application_id' => 'your_application_id',
    'api_key'        => 'your_api_key',
));
$indexes = $client->listIndexes(); // returns an array of your indexes

You can find a list of the client's available commands in the bundle's client.json but basically they should be the same as the api endpoints listed in the docs.