Readded old code of controller for solr integration