Elasticsearch — Core Modules

Module-by-module responsibilities

5. Core modules

server/ — the kernel

Responsibility: Entire node runtime not delegated to modules/x-pack.

Key packages:

  • bootstrapElasticsearch, BootstrapChecks
  • nodeNode, NodeConstruction
  • clusterClusterState, routing, allocation, coordination
  • action — all transport actions (bulk, search, admin)
  • index — shard, engine, translog, mapper, merge
  • search — query DSL, aggregations, SearchService
  • rest — HTTP handler layer
  • transport — inter-node RPC
  • gateway — metadata persistence
  • indicesIndicesService, cluster-state listener

Depends on: libs/core, libs/x-content, Lucene, Log4j, Guice.

Depended on by: every module plugin at runtime (classpath).

Invariants: Cluster state updates only on master; shard writes primary-first; transport thread must not block on Lucene.

libs/ — shared foundations
LibPurpose
coreBase exceptions, collections, BytesReference, ref counting
x-contentJSON/SMILE/CBOR parsing (XContentParser)
cliCommand-line utilities for distribution tools
entitlementJDK 24+ sandbox policy enforcement for plugins
nativeJNI: zstd, vectorization hooks, process limits
plugin-apiStable plugin surface (new SPI direction)
ssl-configTLS context building shared with x-pack security
modules/ — bundled plugins
ModuleRole
transport-netty4Netty4Plugin — HTTP + transport implementations
lang-painlessDefault scripting language for aggs/runtime fields
ingest-commonBuilt-in ingest processors (grok, date, set…)
reindexReindex / update-by-query / delete-by-query actions
repository-s3|gcs|azureSnapshot repositories to cloud object stores
analysis-commonStandard analyzers, token filters
aggregationsMany agg implementations registered via SearchPlugin
data-streamsData stream metadata, rollover hooks
mapper-extrasAdditional field types (dense_vector extras, etc.)
parent-joinjoin field type for parent/child
rank-evalRanking evaluation API
kibanaSystem index descriptors for Kibana

Each module is a JAR with plugin-descriptor.properties and one or more Plugin implementations.

x-pack/plugin/ — licensed features (selected)
PluginRole
coreX-Pack foundation, license checking, unified setup
securityAuthn/z, TLS, role mappings, audit
mlMachine learning jobs, model deployment
esqlES|QL query language (ANTLR parser, columnar exec)
sqlSQL translator to search DSL
ccrCross-cluster replication
ilm / slmIndex / snapshot lifecycle management
watcherAlerting on scheduled queries
statelessObject-store-backed shard engine (cloud architecture)
autoscalingCapacity signals for orchestrators
async-searchLong-running search persistence

Non-obvious: Even "basic" distributions load a subset of x-pack; license level gates features at runtime via LicenseService.

Important server subsystems (within server/)

action/ — transport action layer

ActionModule registers hundreds of TransportAction instances. Pattern: TransportFooAction extends TransportMasterNodeAction (cluster) or TransportBarAction extends TransportAction (data).

TransportAction.execute runs ActionFilter chain then doExecute on a configured Executor (thread pool).

index/mapper/ — document mapping

DocumentMapper, MappingLookup, field mappers (TextFieldMapper, KeywordFieldMapper, …). Parses JSON source into ParsedDocument with Lucene fields. Dynamic mapping triggers MappingUpdatedAction cluster task.

index/engine/ — per-shard storage engine

Engine interface; InternalEngine is default. Handles index/delete/get, refresh, flush, merge, translog retention. EngineFactory pluggable (used by x-pack stateless for IndexEngine/SearchEngine).

search/ — query execution

SearchModule registers queries, aggs, highlighters, suggesters. QueryPhase builds Lucene Weight, collects top docs. FetchPhase loads stored fields / source.

cluster/coordination/ — master election

Coordinator implements pre-voting, leader checks, publication. Replaces legacy Zen discovery. Persists voting configuration in cluster state.

gateway/ — metadata on disk

PersistedClusterStateService writes cluster metadata to disk (Lucid-format data under data/). GatewayService blocks indices until state recovered.

Dependency direction

libs/* ← server ← modules/* / plugins/* / x-pack/* ↑ distribution (packages server + modules into tar/docker) ↑ client/rest (HTTP only, no server)

Plugins never depend on each other directly at compile time; they interact only through registries and cluster state.

Execution Flows · Data & Interfaces →