Skip to content

RDBMS-to-Elasticsearch mapping

RDBMS-to-Elasticsearch mapping refers to the conceptual and structural correspondence between traditional Relational Database Management Systems (RDBMS) and the Elasticsearch search and analytics engine.^[600-developer__Elasticsearch.md]

Conceptual Mapping

Elasticsearch adopts a document-oriented architecture, which differs significantly from the table-oriented structure of relational databases.^[600-developer__Elasticsearch.md] To understand how to model data in Elasticsearch, one can map familiar RDBMS components to their Elasticsearch counterparts^[600-developer__Elasticsearch.md]:

RDBMS Concept Elasticsearch Concept
Table Index
Row Document
Column Field
Schema Mapping
SQL DSL (Domain Specific Language)

Mapping Dynamics

In Elasticsearch, the definition of a document structure—similar to a database schema—is handled by a Mapping^[600-developer__Elasticsearch.md]. This configuration defines how fields within a document are stored and indexed^[600-developer__Elasticsearch.md]:

  • keyword: Used for exact matching (e.g., aggregations or sorting). This type does not undergo text analysis (分詞).^[600-developer__Elasticsearch.md]
  • text: Used for full-text search. This type is analyzed to support inverted indexing and retrieval based on relevance.^[600-developer__Elasticsearch.md]

Mapping can be defined explicitly by the user or configured to be dynamic, allowing the system to infer the schema automatically^[600-developer__Elasticsearch.md].

Sources

  • 600-developer__Elasticsearch.md