As I was upgrading magento for a client I found that by default magento sorts search filters by attribute_id. Old website had different attribute_id than that in new website. So, the filters were displaying in different position in new website than that of old website. I wanted to keep it as the old one, so I updated the position of attributes but that made no difference.
After going through code found the code that pulls attributes: