Skip to content

dblock/opensearch-dotnet-client-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenSearch DotNet (.NET) Client Demo

Makes requests to Amazon OpenSearch using the OpenSearch .NET Client. Supports OpenSearch Serverless since OpenSearch.Net.Auth.AwsSigV4 1.3.0.

Install Prerequisites

DotNet Framework

Install DotNet. YMMV.

$ dotnet --version
7.0.100

Running

Create an OpenSearch domain in (AWS) which support IAM based AuthN/AuthZ and run the demo.

export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_SESSION_TOKEN=
export AWS_REGION=us-west-2

export ENDPOINT=https://....us-west-2.es.amazonaws.com
export SERVICE=es # use 'aoss' for OpenSearch Serverless

dotnet run

The code will connect to OpenSearch, display its version, create an index, add a document, search for it, output the search result, then cleanup.

opensearch: 2.3.0

{
  "Id": 1,
  "Title": "Moneyball",
  "Director": "Bennett Miller",
  "Year": 2011
}

Use DEBUG to trace requests.

DEBUG=1 dotnet run

License

This project is licensed under the Apache v2.0 License.

Copyright

Copyright OpenSearch Contributors. See NOTICE for details.

About

OpenSearch DotNet (.NET) Client Demo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages