https://github.com/mhndev/searchit-client
php sdk for search server (http search server powered by elasticsearch)
https://github.com/mhndev/searchit-client
elasticsearch sdk-php search search-engine
Last synced: 8 months ago
JSON representation
php sdk for search server (http search server powered by elasticsearch)
- Host: GitHub
- URL: https://github.com/mhndev/searchit-client
- Owner: mhndev
- Created: 2017-11-21T09:35:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-26T08:30:27.000Z (almost 8 years ago)
- Last Synced: 2025-01-04T16:43:39.756Z (10 months ago)
- Topics: elasticsearch, sdk-php, search, search-engine
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Searchit Client (SDK)
#### Work in progress
###### Don't use it in production (is not production ready)
#### Sample usage :
```php
namespace mhndev\searchitClient
{
use GuzzleHttp\Client;
/**
* Class HttpGuzzle
* @package mhndev\searchitClient
*/
class HttpGuzzle implements iHttpConnection
{
/**
* @var Client
*/
protected $guzzleClient;
/**
* HttpGuzzle constructor.
* @param Client $guzzleClient
*/
function __construct(Client $guzzleClient)
{
$this->guzzleClient = $guzzleClient;
}
/**
* @param string $uri
* @param string $method
* @param array $options
* @return mixed
*/
function request(string $uri, $method = 'GET', array $options)
{
return $this->guzzleClient->request($method, $uri, $options);
}
}
}
namespace
{
use GuzzleHttp\Client as GuzzleClient;
use mhndev\searchitClient\Client;
use mhndev\searchitClient\Driver\HttpDriver;
use mhndev\searchitClient\HttpGuzzle;
$httpConnection = new HttpGuzzle(new GuzzleClient());
$httpDriver = new HttpDriver($httpConnection);
$searchitClient = (new Client())->setDriver($httpDriver);
$list = $searchitClient->listSearchableTypes();
var_dump($list);die();
}
```