#303 fixed calculation of max_id in search results

now set to min_id-1 of previous results