You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can now import the Algolia API client in your project and play with it.
useAlgolia\AlgoliaSearch\Api\SearchClient;
$client = SearchClient::create('<YOUR_APP_ID>', '<YOUR_API_KEY>');
// Add a new record to your Algolia index$response = $client->saveObject(
'<YOUR_INDEX_NAME>',
['objectID' => 'id',
'test' => 'val',
],
);
// play with the responsevar_dump($response);
// Poll the task status to know when it has been indexed$client->waitForTask('<YOUR_INDEX_NAME>', $response['taskID']);
// Fetch search results, with typo tolerance$response = $client->search(
['requests' => [
['indexName' => '<YOUR_INDEX_NAME>',
'query' => '<YOUR_QUERY>',
'hitsPerPage' => 50,
],
],
],
);
// play with the responsevar_dump($response);
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. You can also open a GitHub issue
Contributing
This repository hosts the code of the generated Algolia API client for PHP, if you'd like to contribute, head over to the main repository. You can also find contributing guides on our documentation website.
📄 License
The Algolia PHP API Client is an open-sourced software licensed under the MIT license.
About
⚡️ A fully-featured and blazing-fast PHP API client to interact with Algolia.