modified to integrate with elastic search