Algolia Search API Client for PHP
, (*1)
This PHP client let you easily use the Algolia Search API from your backend., (*2)
Installation
The Algolia Search API Client is available on Packagist and as such installable via Composer., (*3)
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., (*4)
Composer example
Add "sgrodzicki/algoliasearch-api-client" in your composer.json:, (*5)
{
"require": {
"sgrodzicki/algoliasearch-api-client": "1.0.*"
}
}
Download the library:, (*6)
``` bash
$ php composer.phar update sgrodzicki/algoliasearch-api-client, (*7)
After installing, you need to require Composer's autoloader somewhere in your code:
```php
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., (*8)