The index is already in elasticsearch, I'm trying to add a new field "my_field" with a custom analyzer but this doesn't work.
PUT my_index
{
"settings": {
"analysis": {
"normalizer": {
"my_normalizer": {
"type": "custom",
"filter": ["lowercase"]
}
}
}
},
"mappings": {
"default": {
"properties": {
"my_field": {
"type": "keyword",
"normalizer": "my_normalizer"
}
}
}
}
}
I think it's not possible to add a new analyzer "on the fly".
One solution, is to create a new index with your new analyzer and field. Then you can reindex
your old index into the new one.
https://www.elastic.co/guide/en/elasticsearch/reference/7.1/docs-reindex.html
bye,
Xavier
Okay. Doesn't it make sense to allow adding a normalizer while adding new fields? Is there any reason, why it is restricted?
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.