I am trying to map all fields as text
. Based on the docs, this should work, but it doesn't:
PUT my_type
{
"mappings": {
"my_type": {
"dynamic_templates": [
{
"longs_as_strings": {
"match_mapping_type": "*",
"match": "*",
"mapping": {
"type": "text"
}
}
}
]
}
}
}
PUT my_type/my_type/1
{
"intfield": 5
}
GET my_type/_search
Results in:
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "my_type",
"_type": "my_type",
"_id": "1",
"_score": 1,
"_source": {
"intfield": 5
}
}
]
}
}