Sorting searchbox results by number of characters

Hi, I’m trying to sort results returned when I start typing in a searchbox by the number of characters in the results returned? So I need the results containing my typed text with the shortest result shown on top. Perhaps i’m overlooking something basic.

Would appreciate a point in the right direction. Thank You!