Need a special offer?Find out if your project fits.
+

How to rename fields in elasticsearch?

Answered
test0test0test asked on October 8, 2020

3 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster October 8, 2020

Hi!
 
Thank you for posting your question.
 
Please note that the field names for any data source can be changed with the help of the Flexmonster's Mapping object:
 

mapping: {
"Color": {
type: "String",
caption: "color"
},
...
...

 
More info & examples for this here: https://www.flexmonster.com/api/mapping-object/
 
We hope this helps.
 
Regards,
Mykhailo

Public
test0test0test October 12, 2020

Hello,
 
I have tried the following, but it does not rename the field. Does caption work on Elasticsearch data sources?

mapping: {
"Color": {
type: "String",
caption: "color"
},
Public
Mykhailo Halaida Mykhailo Halaida Flexmonster October 12, 2020

Hi!
 
Thank you for your reply.
 
We'd like to confirm that the caption property is available for the Elasticsearch data source as well. Please make sure you specify the correct field name in your mapping configurations in order for it to work properly.
 
Here's a quick sample illustrating how this can be achieved: https://jsfiddle.net/flexmonster/39cqbx2d/
 
Please let us know if this helps.
 
Best regards,
Mykhailo

Please login or Register to Submit Answer