The perfect starting point to integrate Algolia within your PHP project
Documentation • Laravel • Symfony • Community Forum • Stack Overflow • Report a bug • FAQ • Support
- Thin & minimal low-level HTTP client to interact with Algolia's API
- Supports php
^7.2
.
First, install Algolia PHP API Client via the composer package manager:
composer require algolia/algoliasearch-client-php
Then, create objects on your index:
$client = Algolia\AlgoliaSearch\SearchClient::create(
'YourApplicationID',
'YourAdminAPIKey'
);
$index = $client->initIndex('your_index_name');
$index->saveObjects(['objectID' => 1, 'name' => 'Foo']);
Finally, you may begin searching a object using the search
method:
$objects = $index->search('Fo');
For full documentation, visit the Algolia PHP API Client.
Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client.
If you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check our dedicated guide to learn more.
Algolia PHP API Client is an open-sourced software licensed under the MIT license.