Abstracted out the elastic search calls from the controller