Property | Type | Description | |
---|---|---|---|
$caInfoPath | string | ||
$context | |||
$curlConstants | array | ||
$curlOptions | array | ||
$placesEnabled | boolean |
Method | Description | |
---|---|---|
__construct ( string $applicationID, string $apiKey, array | null $hostsArray = null, array $options = [] ) | Algolia Search initialization. | |
__destruct ( ) | Release curl handle. | |
addUserKey ( array $obj, integer $validity, integer $maxQueriesPerIPPerHour, integer $maxHitsPerQuery, array | null $indexes = null ) : mixed | Create a new user key. | |
batch ( array $requests ) : mixed | Send a batch request targeting multiple indices. | |
buildQuery ( array $args ) : string | ||
copyIndex ( string $srcIndexName, string $dstIndexName ) : mixed | Copy an existing index. | |
deleteIndex ( string $indexName ) : mixed | Delete an index. | |
deleteUserKey ( string $key ) : mixed | Delete an existing user key. | |
disableRateLimitForward ( ) | Disable IP rate limit enabled with enableRateLimitForward() function. | |
doRequest ( |
||
enableRateLimitForward ( string $adminAPIKey, string $endUserIP, string $rateLimitAPIKey ) | Allow to use IP rate limit when you have a proxy between end-user and Algolia. | |
generateSecuredApiKey ( string $privateApiKey, mixed $query, string | null $userToken = null ) : string | Generate a secured and public API Key from a list of query parameters and an optional user token identifying the current user. | |
getLogs ( integer $offset, integer $length = 10, mixed $type = 'all' ) : mixed | Return last logs entries. | |
getUserKeyACL ( string $key ) : mixed | Get ACL of a user key. | |
initIndex ( string $indexName ) : |
Get the index object initialized (no server call needed for initialization). | |
initPlaces ( string $appId, string $apiKey, array $hostsArray = null, array $options = [] ) : |
||
isAlive ( ) | Call isAlive. | |
listIndexes ( ) : mixed | List all existing indexes return an object in the form: array( "items" => array( array("name" => "contacts", "createdAt" => "2013-01-18T15:33:13.556Z"), array("name" => "notes", "createdAt" => "2013-01-18T15:33:13.556Z") ) ). | |
listUserKeys ( ) : mixed | List all existing user keys with their associated ACLs. | |
moveIndex ( string $srcIndexName, string $dstIndexName ) : mixed | Move an existing index. | |
multipleQueries ( array $queries, string $indexNameKey = 'indexName', string $strategy = 'none' ) : mixed | This method allows to query multiple indexes with one API call. | |
request ( |
||
setAlgoliaUserToken ( string $token ) | It's possible to use the following token to track users that have the same IP or to track users that use different devices. | |
setConnectTimeout ( integer $connectTimeout, integer $timeout = 30, integer $searchTimeout = 5 ) | Change the default connect timeout of 2s to a custom value (only useful if your server has a very slow connectivity to Algolia backend). | |
setExtraHeader ( string $key, string $value ) | Allow to set custom headers. | |
setForwardedFor ( string $ip ) | The aggregation of the queries to retrieve the latest query uses the IP or the user token to work efficiently. | |
updateUserKey ( string $key, array $obj, integer $validity, integer $maxQueriesPerIPPerHour, integer $maxHitsPerQuery, array | null $indexes = null ) : mixed | Update a user key. |
Method | Description | |
---|---|---|
checkCurlOptions ( array $curlOptions ) : array | Checks if curl option passed are valid curl options. | |
getCurlConstants ( ) : array | Get all php curl available options. | |
invalidOptions ( array $curlOptions = [], string $errorMsg = '' ) | throw clear Exception when bad curl option is set. |
Method | Description | |
---|---|---|
getPlacesIndex ( ) : |
public __construct ( string $applicationID, string $apiKey, array | null $hostsArray = null, array $options = [] ) | ||
$applicationID | string | the application ID you have in your admin interface |
$apiKey | string | a valid API key for the service |
$hostsArray | array | null | the list of hosts that you have received for the service |
$options | array |
public addUserKey ( array $obj, integer $validity, integer $maxQueriesPerIPPerHour, integer $maxHitsPerQuery, array | null $indexes = null ) : mixed | ||
$obj | array | can be two different parameters: The list of parameters for this key. Defined by an array that can contain the following values: - acl: array of string - indices: array of string - validity: int - referers: array of string - description: string - maxHitsPerQuery: integer - queryParameters: string - maxQueriesPerIPPerHour: integer Or the list of ACL for this key. Defined by an array of string that can contains the following values: - search: allow to search (https and http) - addObject: allows to add/update an object in the index (https only) - deleteObject : allows to delete an existing object (https only) - deleteIndex : allows to delete index content (https only) - settings : allows to get index settings (https only) - editSettings : allows to change index settings (https only) |
$validity | integer | the number of seconds after which the key will be automatically removed (0 means no time limit for this key) |
$maxQueriesPerIPPerHour | integer | Specify the maximum number of API calls allowed from an IP address per hour. Defaults to 0 (no rate limit). |
$maxHitsPerQuery | integer | Specify the maximum number of hits this API key can retrieve in one call. Defaults to 0 (unlimited) |
$indexes | array | null | Specify the list of indices to target (null means all) |
return | mixed |
public static buildQuery ( array $args ) : string | ||
$args | array | |
return | string |
protected checkCurlOptions ( array $curlOptions ) : array | ||
$curlOptions | array | must be array but no type required while first test throw clear Exception |
return | array |
public deleteIndex ( string $indexName ) : mixed | ||
$indexName | string | the name of index to delete |
return | mixed | an object containing a "deletedAt" attribute |
public deleteUserKey ( string $key ) : mixed | ||
$key | string | |
return | mixed |
public disableRateLimitForward ( ) |
public doRequest ( |
||
$context | ||
$method | string | |
$host | string | |
$path | string | |
$params | array | |
$data | array | |
$connectTimeout | integer | |
$readTimeout | integer | |
return | mixed |
public enableRateLimitForward ( string $adminAPIKey, string $endUserIP, string $rateLimitAPIKey ) | ||
$adminAPIKey | string | the admin API Key you can find in your dashboard |
$endUserIP | string | the end user IP (you can use both IPV4 or IPV6 syntax) |
$rateLimitAPIKey | string | the API key on which you have a rate limit |
public static generateSecuredApiKey ( string $privateApiKey, mixed $query, string | null $userToken = null ) : string | ||
$privateApiKey | string | your private API Key |
$query | mixed | the list of query parameters applied to the query (used as security) |
$userToken | string | null | an optional token identifying the current user |
return | string |
protected getCurlConstants ( ) : array | ||
return | array |
public getLogs ( integer $offset, integer $length = 10, mixed $type = 'all' ) : mixed | ||
$offset | integer | Specify the first entry to retrieve (0-based, 0 is the most recent log entry). |
$length | integer | Specify the maximum number of entries to retrieve starting at offset. Maximum allowed value: 1000. |
$type | mixed | |
return | mixed |
public getUserKeyACL ( string $key ) : mixed | ||
$key | string | |
return | mixed |
protected invalidOptions ( array $curlOptions = [], string $errorMsg = '' ) | ||
$curlOptions | array | |
$errorMsg | string | add specific message for disambiguation |
public listIndexes ( ) : mixed | ||
return | mixed |
public listUserKeys ( ) : mixed | ||
return | mixed |
public request ( |
||
$context | ||
$method | string | |
$path | string | |
$params | array | |
$data | array | |
$hostsArray | array | |
$connectTimeout | integer | |
$readTimeout | integer | |
return | mixed |
public setAlgoliaUserToken ( string $token ) | ||
$token | string |
public setExtraHeader ( string $key, string $value ) | ||
$key | string | |
$value | string |
public setForwardedFor ( string $ip ) | ||
$ip | string |
public updateUserKey ( string $key, array $obj, integer $validity, integer $maxQueriesPerIPPerHour, integer $maxHitsPerQuery, array | null $indexes = null ) : mixed | ||
$key | string | |
$obj | array | can be two different parameters: The list of parameters for this key. Defined by a array that can contains the following values: - acl: array of string - indices: array of string - validity: int - referers: array of string - description: string - maxHitsPerQuery: integer - queryParameters: string - maxQueriesPerIPPerHour: integer Or the list of ACL for this key. Defined by an array of string that can contains the following values: - search: allow to search (https and http) - addObject: allows to add/update an object in the index (https only) - deleteObject : allows to delete an existing object (https only) - deleteIndex : allows to delete index content (https only) - settings : allows to get index settings (https only) - editSettings : allows to change index settings (https only) |
$validity | integer | the number of seconds after which the key will be automatically removed (0 means no time limit for this key) |
$maxQueriesPerIPPerHour | integer | Specify the maximum number of API calls allowed from an IP address per hour. Defaults to 0 (no rate limit). |
$maxHitsPerQuery | integer | Specify the maximum number of hits this API key can retrieve in one call. Defaults to 0 (unlimited) |
$indexes | array | null | Specify the list of indices to target (null means all) |
return | mixed |