Proper mapping is key for efficient search.
Types¶
- text — full-text
- keyword — exact match, aggregations
- integer/float
- date
- nested
- geo_point
Mapping¶
PUT /articles
{
"mappings": {
"properties": {
"title": {"type":"text","analyzer":"english"},
"slug": {"type":"keyword"},
"tags": {"type":"keyword"},
"published_at": {"type":"date"}
}
}
}
Mapping = Foundation¶
Define explicitly. Dynamic = prototypes only.
elasticsearchmappingschema