PHP code example of searchili / searchili-client-php

1. Go to this page and download the library: Download searchili/searchili-client-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

searchili / searchili-client-php example snippets




earChili\Alice\Client as SearChiliAliceClient;

$client = new SearChiliAliceClient('<apiKey>');

$entities = $client->entity->search('query');
print_r($entities);



earChili\Bob\Client as SearChiliBobClient;

$client = new SearChiliBobClient('<apiSecret>');

$response = $client->site->get();
print_r($response->toArray());

$result = $aliceClient->entity->store(
    1, // ID
    'Example Title', // Title
    'http://domain.com/article-1', // Link
    'This is excerpt', // Excerpt
    'This will be the long body of this amazing article.' // Body
);
print_r($result);

$result = $aliceClient->entity->delete(1);
var_dump($result);
composer
composer 
json
{
    "SearChili/searchili-client-php": "^1.0"
}