Updated: Comment #N
The NodeSearch plugin for the Search module (Core search's ability to search nodes) allows admins to decide how to rank search results, using one or more scoring algorithms. These are provided by hook_ranking(), and the scores are supposed to be values between 0 and 1 for each node.
The ranking algorithm that ranks most recent content first is not providing values that cover this range well. This breaks the ability for admins to choose to rank more recent code higher in search results.
Fix the recency ranking implementation so that the node rankings for most recently updated content work better.
Viable patch with tests.
None, except search results will match ranking set-ups better.
None.
During my Summer of Code project I noticed that the algorithm used to normalize and adjust the score given to nodes based on their recency was not producing values spread across the range of [0,1]. Using the devel module after completing a search I copy and pasted the query used to gather the results to see how the scores of the results were being distributed. I found that most often times the score attributed to a recent node was so small that it was essentially meaningless when compared to the score of other ranking modifiers.
Using this new algorithm nodes with recent timestamps receive scores that approach the maximum (the score given to it in the search admin screen) while previously this was not the case. I have attached a screen shot of the score results for a search done on a set of nodes created with a few weeks of the search. Additionally I have attached another screen shot of the same search using the old ranking algorithm. I'd love to get some more feedback on this.
Additional discussion:
Fixed
8.0 β°οΈ
search.module
After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.