I have a field in my elasticsearch that I wish to be able to update using the _update API. Currently I make a request and change the value of field FIELD to VALUE using this body:
However, when I show my data in Kibana, I want to use a more descriptive fieldname, such as TEST VALUES. My question is if there is a simple solution two make my two wishes come true?
I have tried field alias in ES, but the field never shows up in the index pattern in Kibana (I made sure to even try create a new index for this). I PUT the following body to my elasticsearch instance at http://localhost:9200/myindex/_mapping:
Thank you for the solid answer. I am guessing for the time being it will have to be. But would Scripted fields be a possible solution? Do they update fields in real-time, so that I can calculate a new field based on the field I update, with no or minimal changes?
Yes, scripted fields would be an option for this - they are calculated at request time, which gives them a lot of flexibility with the cost of performance when it comes to large amounts of data (as they can't be indexed because of their dynamic nature). It's definitely a good start though (especially because it's so easy to do).
If the performance penalty becomes a problem, consider re-indexing your data with an ingest pipeline using a script processor - this is basically the same thing, but executed just once at ingest time. This means it's way harder to change a script (because you have to crunch through all of your data once), but after that's done it's as fast a regular fields.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.