How to convert string field to number using painless script to visualize in kibana

Hi Vafa,
The best advice I can give is to create template which include mapping for each field,
And rebuild the indices.