Configure mapping for elasticsearch

Answered
Francisco Jose Gomez Vargas asked on April 28, 2021

Hi, im trying to configure in my mapping section some captions for some fields i got this: 
"fechas": {
"year": "2019",
"month": "Enero",
"numberMonth": 1
}
Im able to edit the caption of the answer of the fields but not the field caption, instead this is what i get (image), im trying to edit the fields fechas, year and month caption. This is my code:

            "fechas": {
              "caption" : "fechas",
            },

            
            "fechas.month": {

              "caption" : "Mes"
            },

            "fechas.year": {
              "caption" : "Año",
            },

3 answers

Public
Vera Didenko Vera Didenko Flexmonster April 29, 2021

Hello, Francisco,
 
Thank you for writing to us. 
 
To change the field's caption, we kindly suggest using the field's uniqueName.
For example, in our Elasticsearch demo, the "Category" field has the following uniqueName: "Category.keyword".
Hence, its caption can be changed by specifying its uniqueName in the mapping property the following way:

var pivot = new Flexmonster({
...
report: {
"dataSource": {
"type": "elasticsearch",
"node": "https://olap.flexmonster.com:9200",
"index": "fm-product-sales",
"mapping": {
"@timestamp": { "visible": false },
"@version": { "visible": false },
"host": { "visible": false },

"Category.keyword": { "caption": "My Category" }
}
},
"slice": {...}
}
});

We have prepared a JSFiddle for illustration: https://jsfiddle.net/flexmonster/yaevhdg1/.
 
If the field is located in a folder, the uniqueName should contain the folder names separated by a period (.). For example, if the field "Fecha_Mes" is located under the "fechas" -> "month" subfolder, the uniqueName will be "fechas.month.Fecha_Mes".
 
Please let us know if this helps.
Looking forward to your response.
 
Kind regards,
Vera

Public
Francisco Jose Gomez Vargas April 29, 2021

Hi Vera indeed what you show me is pretty usefull but, in this case for example
The field "Fecha_Mes" is located under "fechas" -> "month" subfolder but i dont want to change "Fecha_mes" caption, i would like to change the folders names, for example "fechas" and "month"
 
We have any way of doing this?

Public
Vera Didenko Vera Didenko Flexmonster April 30, 2021

Hello, Francisco,
 
Thank you for your reply. 
 
Currently, Flexmonster supports setting captions only for the fields and measures. The folders received from Elasticsearch can't be renamed on Flexmonster's end.
However, it is possible to simplify the folder structure by specifying the simplifyFieldListFolders report option. This setting indicates whether the folders containing one field should show this field in the root (true) or not (false). 
 
Please let us know if any further questions arise.
 
Kind regards,
Vera

Please login or Register to Submit Answer