An ASP.NET Core 8 Web API project demonstrating how to integrate Elasticsearch for indexing and searching data.
This project follows a layered architecture and consists of the following layers:
-
ElasticsearchExample.Domain
- Holds the domain models (e.g.
Product
). - Represents the core entities used by the application.
- Holds the domain models (e.g.
-
ElasticsearchExample.ElasticsearchService
- Contains the logic for connecting to Elasticsearch via NEST.
- Provides methods to create indices, insert documents, update, delete, and perform searches.
-
ElasticsearchExample.Presentation
- The ASP.NET Core Web API layer.
- Exposes endpoints (controllers) for CRUD operations (Create, Read, Update, Delete) and searching.
- .NET 8 (ASP.NET Core)
- Elasticsearch (run via Docker using the official Elasticsearch image)
- NEST (for Elasticsearch communication)
Use the provided docker-compose.yml
to run Elasticsearch (and Kibana) locally:
docker-compose up -d