Index management
Elastic.Ingest.Elasticsearch supports several index management strategies. The right choice depends on your data pattern, whether you need rollover, and whether you're running on serverless or self-managed Elasticsearch.
| Use case | Strategy | Serverless? | Guide |
|---|---|---|---|
| Simple fixed index | Single index | Yes | Single index |
| Alias-based rotation | Manual alias swap | Yes | Manual alias |
| Condition-based rotation | Rollover API | Yes | Rollover API |
| Automatic lifecycle | ILM managed | No | ILM managed |
| Simplified lifecycle | Data stream lifecycle | Yes | Data stream lifecycle |
| Append-only time-series | Data streams | Yes | Data streams |
| TSDB metrics | TSDB mode | Yes | TSDB |
| Log ingestion | LogsDB / Wired Streams | Yes | LogsDB |
The EntityTarget in your mapping context controls which index management strategy the channel uses:
| EntityTarget | Description | Bootstrap |
|---|---|---|
Index |
Traditional Elasticsearch index. Supports updates, upserts, aliases. | Component + index templates |
DataStream |
Append-only data stream. Automatic rollover and lifecycle. | Component + data stream templates |
WiredStream |
Serverless managed stream. No local bootstrap needed. | No-op |
When you call BootstrapElasticsearchAsync, the channel executes its bootstrap strategy steps in order:
- ComponentTemplateStep: creates settings and mappings component templates, computes a content hash
- IndexTemplateStep or DataStreamTemplateStep: creates the index template referencing the component templates
- Optional steps:
IlmPolicyStep,DataStreamLifecycleStep,InferenceEndpointStep
If the index template already exists with the same content hash, the PUT is skipped entirely. This makes bootstrap safe to call on every startup.