Use LCS to Rank Matches #20
Description
I suggest using LCS to rank matches:
https://en.wikipedia.org/wiki/Longest_common_subsequence_problem#Solution_for_two_sequences
Matches with lower number of substrings would come before matches with higher number of substrings.
This would be a lot more generic than the substring() based approach suggested in some PRs.
If you want to play with this, here's an online thing demonstrating the concept (I didn't write this, just found it):
http://lcs-demo.sourceforge.net/
Start by upping the "Max Size" a bit, then type in two strings and press "Execute LCS Lengths" to see how it works.
One real-world use case where this would come in handy is when searching for "git push", note how it's third place even though "git" and "push" are exact matches. Single-word matches would be caught by this as well.