opensearch-net icon indicating copy to clipboard operation
opensearch-net copied to clipboard

[FEATURE] Integrate with the Microsoft.Extensions ecosystem

Open glen-84 opened this issue 11 months ago • 2 comments

Is your feature request related to a problem?

It should be easier to set up the OpenSearch client in an ASP.NET Core application.

What solution would you like?

builder.Services.AddOpenSearchClient(...)

... and configuration in appsettings.json, and logging with the ILogger.

What alternatives have you considered?

https://github.com/MintPlayer/MintPlayer.AspNetCore.OpenSearch This is the only relevant library that I could find on NuGet, but it's not popular/official.

Otherwise, doing it all manually.

Do you have any additional context?

n/a

glen-84 avatar Jul 07 '23 13:07 glen-84

Hi @glen-84!

Thanks for sharing your feature request, I think it'd be helpful if you could expand a bit on what you'd like to see added/supported. Such as what types would you expect to be registered with the service collection, how might the configuration be structured, and what do you think the client should be logging itself.

Xtansia avatar Jul 10 '23 11:07 Xtansia

what types would you expect to be registered with the service collection

An IOpenSearchClient.

how might the configuration be structured

Maybe something like:

"OpenSearchClients": {
    "Search": { // Named client.
        "ConnectionPool": {
            "Nodes": [
                {
                    "Uri": "http://127.0.0.1:9201"
                },
                {
                    "Uri": "http://127.0.0.1:9202"
                }
            ]
        }
    }
}

what do you think the client should be logging itself

Maybe something like this (at the information level).

glen-84 avatar Jul 11 '23 13:07 glen-84