A step-by-step guide to querying Elasticsearch from a .NET application using a typed HttpClient instead of the official Elasticsearch client libraries. Covers creating a typed client interface with three search methods (by company name, by name and state, and paginated all-results), wiring it up via HttpClientFactory in Startup.cs, and exposing the searches through an ASP.NET Core API controller with constructor injection.

4m read timeFrom nodogmablog.bryanhogan.net
Post cover image
Table of contents
The Typed HttpClientThe Setup