implemented search functionality - mongoid