as-cache: Use correct FTS value per result#268
Conversation
|
Oh wow... I think you are correct with your assumptions, the current code will always read the match score of the search token for the first component in the list, and not of the one that we are actually looking for, which yields worse search results. Do you have a real-world example that this change made better? (I'm curious as to how you found this in the first place) In any case, the patch as it is looks fine to me, thank you very much! |
|
I came across this by chance when I was trying to figure out where the score actually came from so I could write #269 , which I'd greatly appreciate your input on when you have time 🙂 I tested this with en_GB localisation on elementary OS (technically Ubuntu 18.04 AppStream data with a few extras) with a search query of "builder", and the results were definitely better. Before: After: Edit: worth noting that we've already backported 0.12.10 to this version of elementary, so there probably weren't any other search changes that would have influenced the above output. |
I've been looking into some of the searching/sorting logic and I'm not 100% sure on this change due to not being overly familiar with the code and not having worked the logic all the way back yet, but given that
It looks like there is one
AsTokenTypeper result, yet it seems the pointer arithmetic for updatingsort_scoredoesn't take the array index into account.