Nastavení služby pro Opensearch
- Allconius
- Člen | 317
Ahoj, nastavil jsem si službu pro Openseach v services.neon:
opensearch.client:
factory: OpenSearch\ClientBuilder::create()
setup:
- setHosts(['http://localhost:9200'])
- setBasicAuthentication('michal', '*****')
- build()
type: OpenSearch\Client
ale vrací se mi objekt ClientBuilder místo Client:
TypeError
Container_a6bcc07291::createServiceOpensearch__client(): Return value must be of type OpenSearch\Client, OpenSearch\ClientBuilder returned
824: public function createServiceOpensearch__client(): OpenSearch\Client
825: {
826: $service = OpenSearch\ClientBuilder::create();
827: $service->setHosts(['http://localhost:9200']);
828: $service->setBasicAuthentication('michal', '*****');
829: $service->build();
830: return $service;
831: }
- Allconius
- Člen | 317
Ahoj, ok díky, vytvořím si objekt v konstruktoru podle dokumentace:
$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();
ta služba v services.neon možná funguje jen pro Elasticsearch