Hi,
I am using below script for getting scripted fields and also in aggregation. and it works fine, but I was wondering if there is some other better way of doing this.
"script_fields": {
"CustomColumn1": {
"script": " (( ((params._source['productDescription'].toLowerCase().indexOf('chain') > -1)) )) ? ('ChainQuantity') : (( ((params._source['productDescription'].toLowerCase().indexOf('ribbon') > -1)) )) ? ('Ribbon_QTY') : 'blank'"
}
}
Please suggest