opensearch-project / opensearch-php

Official PHP Client for OpenSearch
Other
109 stars 58 forks source link

[BUG] When try to conect instance OpenSearch #157

Closed federicosanchez18 closed 1 year ago

federicosanchez18 commented 1 year ago

Hi ,

I install the cliente php with this command composer require opensearch-project/opensearch-php

When i try connect with my instance local in Open Search dont found the librery ` namespace App\Http\Controllers;

require DIR . '/vendor/autoload.php';

use Illuminate\Http\Request;

class OpenSearchController extends Controller {

private $client;

public function __construct()
{
    $this->connect();
}

public function connect()
{
    $client = (new \OpenSearch\ClientBuilder())
        ->setHosts(['https://localhost:9200'])
        ->setBasicAuthentication('admin', 'admin') // For testing only. Don't store credentials in code.
        ->setSSLVerification(false) // For testing only. Use certificate for validation
        ->build();
}

`

the error is Undefined type 'OpenSearch\ClientBuilder'

Thanks

federicosanchez18 commented 1 year ago

Resolver problema . The problems is with mi laravel version .