Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 540 Bytes

03_Usage.md

File metadata and controls

32 lines (23 loc) · 540 Bytes

Usage of the Opensearch Client Bundle

The Opensearch Client can be injected into any service setting the argument of your service:

    App\Service\MyService:
        arguments:
            $openSearchClient: '@pimcore.open_search_client.<client_name>'

The Client can then be used in your service:

<?php

namespace App\Service;

use OpenSearch\Client;

final class MyService
{
    public function __construct(
        private readonly Client $openSearchClient
    )
    {
        //...
    }
    
    // ...
}