Fix bug to handle the new key format in prefix_search