The Search API client is part of the algoliasearch-client-php package. To install this package, run:

1
composer require algolia/algoliasearch-client-php

To use the Search client, add this import to your files:

1
use Algolia\AlgoliaSearch\Api\SearchClient;

To create an instance of the client:

1
$client = SearchClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');

Indices

Algolia automatically creates a new index when you add records, rules, or synonyms, or when you change settings for an index that doesn’t yet exist. You don’t need to create indices explicitly.

Don’t include sensitive or personally identifiable information (PII) in your index names. They appear in network requests and are publicly visible.

List of methods

Each method makes one request to the Search API. The Search API client also includes helper methods that wrap one or more of these methods. For more information, see Helper methods.

Records

Indices

Synonyms

API keys

Rules

Dictionaries

Clusters

Vaults

Advanced

Did you find this page helpful?
PHP API clients v4