---
title: "Projecting Marten events to Elasticsearch"
url: https://daily.dev/posts/projecting-marten-events-to-elasticsearch-qafchm8as
source_url: https://event-driven.io/en/projecting_from_marten_to_elasticsearch
type: article
source: "Event-Driven by Oskar Dudycz"
published: 2026-06-17T11:26:18.040Z
updated: 2026-06-17T11:31:35.905Z
tags: ["architecture", ".net", "elk"]
reading_time: 9
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Projecting Marten events to Elasticsearch

**[Event-Driven by Oskar Dudycz](https://daily.dev/sources/event-driven-io)** · 9 min read · 0 upvotes · 0 comments

## Summary

A practical guide to building custom Marten projections that write to Elasticsearch asynchronously. The post walks through implementing the IProjection interface, creating a reusable ElasticsearchProjection base class, and a typed generic variant that lets developers register per-event apply lambdas. Key design decisions include using Marten's async daemon for ordering and delivery guarantees, avoiding two-phase commit by relying on eventual consistency, and leveraging Elasticsearch's bulk API for efficient batch indexing. A concrete Order domain example illustrates the full pattern, which can be adapted for other external stores like MongoDB or Neo4j.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://event-driven.io/en/projecting_from_marten_to_elasticsearch>

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#.net](https://daily.dev/tags/.net), [#elk](https://daily.dev/tags/elk)

[View this post on daily.dev](https://daily.dev/posts/projecting-marten-events-to-elasticsearch-qafchm8as)
