working pagination and elastic search