SlideShare a Scribd company logo
1 of 9
INTRODUCTION TO
MAPPINGby Bo Andersen - codingexplained.com
OUTLINE
➤ What is mapping in Elasticsearch?
➤ Field data types
➤ Meta fields
➤ Dynamic mapping
➤ Explicit mapping
➤ Mapping gotchas
WHAT IS MAPPING IN ELASTICSEARCH?
➤ Defines how documents and their fields are stored and indexed
➤ Most commonly involves defining the data types for fields
➤ Quite similar to database schemas for relational databases
➤ Can also be used to
➤ Define the format of date fields
➤ Define whether or not field values should be indexed into the catch-all _all field
➤ ... and more!
FIELD DATA TYPES
➤ A mapping type contains fields
➤ E.g. title, category, content for an "article" type
➤ Each field has a data type
➤ E.g. string, long, double, boolean, date, ...
➤ These data types can be defined in the mapping
➤ Similar to data types for columns in relational databases
META FIELDS
➤ A mapping type also contains meta fields
➤ The behavior of some of the meta fields can be customized
➤ Examples
➤ _id
➤ _type
➤ _uid
➤ _index
DYNAMIC MAPPING
➤ The automatic detection and addition of new types and fields
➤ Fields and mapping types do not need to be defined before being used
➤ You can add a document without first defining a mapping type and defining its
fields
➤ You can even add a document without creating an index
➤ Elasticsearch will create the index, mapping type and fields automatically
➤ Elasticsearch will infer the data types based on the document's data
EXPLICIT MAPPING
➤ Enables you to specify explicit mappings
➤ When creating an index, mapping types and field mappings can be created
➤ These can also be added to existing indexes by issuing a PUT request
➤ Useful if you have some requirements for the data (e.g. specific date formats)
➤ Useful if Elasticsearch cannot guess or infer the correct mapping information
➤ Dynamic mapping is great for getting started, but eventually you will probably want to
add explicit mappings
MAPPING GOTCHAS
➤ Existing type and field mappings cannot be updated
➤ Create a new index and reindex your data into that index
➤ Fields are shared across mapping types
➤ If a title field exists in both an employee and article mapping type, the fields
must have exactly the same mapping in each type
➤ Can be resolved by choosing more descriptive names, e.g. employee_title and
article_title
THANK YOU FOR
WATCHING!

More Related Content

What's hot (20)

B tree
B treeB tree
B tree
 
Data indexing presentation
Data indexing presentationData indexing presentation
Data indexing presentation
 
Data exchange over internet (XML vs JSON)
Data exchange over internet (XML vs JSON)Data exchange over internet (XML vs JSON)
Data exchange over internet (XML vs JSON)
 
Pattern matching & file input and output
Pattern matching & file input and outputPattern matching & file input and output
Pattern matching & file input and output
 
Dutch Government Business Case
Dutch Government Business CaseDutch Government Business Case
Dutch Government Business Case
 
Zhishi.me - Weaving Chinese Linking Open Data
Zhishi.me - Weaving Chinese Linking Open DataZhishi.me - Weaving Chinese Linking Open Data
Zhishi.me - Weaving Chinese Linking Open Data
 
Files
FilesFiles
Files
 
Sql introduction
Sql introductionSql introduction
Sql introduction
 
Annotating search results from web databases
Annotating search results from web databasesAnnotating search results from web databases
Annotating search results from web databases
 
File organization 1
File organization 1File organization 1
File organization 1
 
How web searching engines work
How web searching engines workHow web searching engines work
How web searching engines work
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Jhu Week 6
Jhu Week 6Jhu Week 6
Jhu Week 6
 
An hour with Database and SQL
An hour with Database and SQLAn hour with Database and SQL
An hour with Database and SQL
 
F Database
F DatabaseF Database
F Database
 
Data structure
Data structureData structure
Data structure
 
DATA BASE MODEL Rohini
DATA BASE MODEL RohiniDATA BASE MODEL Rohini
DATA BASE MODEL Rohini
 
Indexing and hashing
Indexing and hashingIndexing and hashing
Indexing and hashing
 
Xml databases
Xml databasesXml databases
Xml databases
 
Database
DatabaseDatabase
Database
 

Similar to Introduction to Elasticsearch Mapping

Elasticsearch: Removal of types
Elasticsearch: Removal of typesElasticsearch: Removal of types
Elasticsearch: Removal of typesTaimur Qureshi
 
Lecture 01 Intro to DSA
Lecture 01 Intro to DSALecture 01 Intro to DSA
Lecture 01 Intro to DSANurjahan Nipa
 
Presentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and morePresentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and moreKwadjoOwusuAnsahQuar
 
Arches Getty Brownbag Talk
Arches Getty Brownbag TalkArches Getty Brownbag Talk
Arches Getty Brownbag Talkbenosteen
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdataFraboni Ec
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdataJames Wong
 
Search engine. Elasticsearch
Search engine. ElasticsearchSearch engine. Elasticsearch
Search engine. ElasticsearchSelecto
 
Elasticsearch - basics and beyond
Elasticsearch - basics and beyondElasticsearch - basics and beyond
Elasticsearch - basics and beyondErnesto Reig
 
Lecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxLecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxmueedmughal88
 
Unit 3 - Transparent tables in the ABAP Dictionary
Unit 3 - Transparent tables in the ABAP DictionaryUnit 3 - Transparent tables in the ABAP Dictionary
Unit 3 - Transparent tables in the ABAP Dictionarydubon07
 

Similar to Introduction to Elasticsearch Mapping (20)

Elasticsearch: Removal of types
Elasticsearch: Removal of typesElasticsearch: Removal of types
Elasticsearch: Removal of types
 
Lecture 01 Intro to DSA
Lecture 01 Intro to DSALecture 01 Intro to DSA
Lecture 01 Intro to DSA
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
XML schemas
XML schemasXML schemas
XML schemas
 
Presentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and morePresentations, Documents, Infographics, and more
Presentations, Documents, Infographics, and more
 
Arches Getty Brownbag Talk
Arches Getty Brownbag TalkArches Getty Brownbag Talk
Arches Getty Brownbag Talk
 
Metadata mapping
Metadata mappingMetadata mapping
Metadata mapping
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Database
DatabaseDatabase
Database
 
Search engine. Elasticsearch
Search engine. ElasticsearchSearch engine. Elasticsearch
Search engine. Elasticsearch
 
Elasticsearch - basics and beyond
Elasticsearch - basics and beyondElasticsearch - basics and beyond
Elasticsearch - basics and beyond
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
Lecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxLecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptx
 
Unit 3 - Transparent tables in the ABAP Dictionary
Unit 3 - Transparent tables in the ABAP DictionaryUnit 3 - Transparent tables in the ABAP Dictionary
Unit 3 - Transparent tables in the ABAP Dictionary
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Introduction to Elasticsearch Mapping

  • 1. INTRODUCTION TO MAPPINGby Bo Andersen - codingexplained.com
  • 2. OUTLINE ➤ What is mapping in Elasticsearch? ➤ Field data types ➤ Meta fields ➤ Dynamic mapping ➤ Explicit mapping ➤ Mapping gotchas
  • 3. WHAT IS MAPPING IN ELASTICSEARCH? ➤ Defines how documents and their fields are stored and indexed ➤ Most commonly involves defining the data types for fields ➤ Quite similar to database schemas for relational databases ➤ Can also be used to ➤ Define the format of date fields ➤ Define whether or not field values should be indexed into the catch-all _all field ➤ ... and more!
  • 4. FIELD DATA TYPES ➤ A mapping type contains fields ➤ E.g. title, category, content for an "article" type ➤ Each field has a data type ➤ E.g. string, long, double, boolean, date, ... ➤ These data types can be defined in the mapping ➤ Similar to data types for columns in relational databases
  • 5. META FIELDS ➤ A mapping type also contains meta fields ➤ The behavior of some of the meta fields can be customized ➤ Examples ➤ _id ➤ _type ➤ _uid ➤ _index
  • 6. DYNAMIC MAPPING ➤ The automatic detection and addition of new types and fields ➤ Fields and mapping types do not need to be defined before being used ➤ You can add a document without first defining a mapping type and defining its fields ➤ You can even add a document without creating an index ➤ Elasticsearch will create the index, mapping type and fields automatically ➤ Elasticsearch will infer the data types based on the document's data
  • 7. EXPLICIT MAPPING ➤ Enables you to specify explicit mappings ➤ When creating an index, mapping types and field mappings can be created ➤ These can also be added to existing indexes by issuing a PUT request ➤ Useful if you have some requirements for the data (e.g. specific date formats) ➤ Useful if Elasticsearch cannot guess or infer the correct mapping information ➤ Dynamic mapping is great for getting started, but eventually you will probably want to add explicit mappings
  • 8. MAPPING GOTCHAS ➤ Existing type and field mappings cannot be updated ➤ Create a new index and reindex your data into that index ➤ Fields are shared across mapping types ➤ If a title field exists in both an employee and article mapping type, the fields must have exactly the same mapping in each type ➤ Can be resolved by choosing more descriptive names, e.g. employee_title and article_title