관련: .mapping 파일
참고: https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html
to index the same field in different ways for different purposes.
This is the purpose of multi-fields.
For instance,
PUT my-index-000001
{
"mappings": {
"properties": {
"city": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
}
}
}
}
GET my-index-000001/_search
{
"query": {
"match": {
"city": "york"
}
},
"sort": {
"city.raw": "asc"
},
"aggs": {
"Cities": { // my agg name
"terms": {
"field": "city.raw"
}
}
}
}