I would expect the first item "mr. h" to have a higher score than the other 2, since it has only 1 character difference compared to the search query, while the others have two differences. However, all 3 scores are equal.
This behaviour only seems to be present when the list items are longer than the search query, and are identical up to the length of the search query, but have differences beyond that.
Is this expected behaviour? If so, could you explain why that's the case?
Consider this very basic example to illustrate what I mean.
List of Items to search through:
Search Term:
let searchTerm = "mr.h"
Notice that the search term is almost equivalent to the first result- the only difference is the missing space after the ".".
Running the search produces the following results:
I would expect the first item "mr. h" to have a higher score than the other 2, since it has only 1 character difference compared to the search query, while the others have two differences. However, all 3 scores are equal.
This behaviour only seems to be present when the list items are longer than the search query, and are identical up to the length of the search query, but have differences beyond that.
Is this expected behaviour? If so, could you explain why that's the case?