Add search query with max id