Find best matching types first in :search with a priority queue.