Change the data type mapping of a field

Hi,

I have a loaded index in Kibana. I need to perform a regex search on one of the fields. The field is currently type 'text' and the regex search doesn't seem to work correctly on 'text' fields. I have tested my regex searches on 'keyword' fields and they work perfectly. Therefore I am looking to change the field from 'text' to 'keyword' so I can perform regex searches on this field.

Is this possible and if so, how can it be achieved?

Thanks

Use this tip:
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html

POST /twitter/_close

PUT /twitter/_settings
{
"analysis" : {
"analyzer":{
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}

POST /twitter/_open

Adapt to your case.

That won't work unfortunately. You will need to reindex with a mapping that matches what you want.

ok, so the only resolution is to create a new index with new mappings and input all the data again ?

I did more research today and found the re index API which seems to achieve the task I want.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.