Mapping
- tags
- Elasticsearch, OpenSearch
summary #
es, ref How Elasticsearch(and full text search) works?, book, evernote
Mapping is the process of defining how a document, and the fields it contains, are stored and indexed. Note: Indexing and storing are two different things: indexing is related to search and storing is related to Database and persistence.
Each document is a collection of fields, which each have their own data type. When mapping your data, you create a mapping definition, which contains a list of fields that are pertinent to the document. A mapping definition also includes metadata fields, like the _source field, which customize how a document’s associated metadata is handled.
Examples #
PUT /my-index-000001
"mappings":
"properties":
"age": "type": "integer" ,
"email": "type": "keyword" ,
"name": "type": "text"
PUT /my-index-000001/_mapping
"properties":
"employee-id":
"type": "keyword",
"index": false
Using mapping to associate an Analyzer with field.