add correctness assertion to search_with_prefix