in reply to Re^3: Stats for super search look buggy
in thread Stats for super search look buggy

Right, but I don't think that the delta merely being larger than the gap is a sufficient test; we should check whether the search actually spans the gap:

$delta -= jump if $first_node_in_search_range <= 1233781 && $last_node_in_search_range >= 11100000;

Replies are listed 'Best First'.
Re^5: Stats for super search look buggy
by LanX (Saint) on May 10, 2021 at 09:49 UTC
    Diminishing the bigger a ° value by the gap-distance, if it exceeds the threshold, is sufficient.

    $bigger_node_in_search_range -= $jump if $bigger_node_in_search_range > 1233781;

    for ($node_min, $node_max) { $_ -= $jump if $_ > 1233781; }

    Calculate percentage then

    update

    °) sorry, both could have jumped.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      that looks more complicated to me. and less easily understood for a future maintainer. :-)

        > less easily understood for a future maintainer

        Au contraire, it's reversing the problem 1-to-1.

        I'd use an anonymous sub encapsulating the transformation and documenting the reason why.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Re^5: Stats for super search look buggy
by pryrt (Abbot) on May 10, 2021 at 13:39 UTC
    Good point. As of today, I don't see a way that the delta would be over 9 million if it wasn't crossing the gap without another 9million posts or another gap, but might as well future-proof it ... and just because I don't see something doesn't mean it doesn't exist.

    My reply was a rather off-the-cuff, first-level approximation of how I thought I might solve it, rather than a fully fleshed-out solution, with implications and edge cases considered. Also, I also realized that my reply could have come across as "why haven't you come up with this", which isn't what I intended; rather, I meant something more like "but at least the fix shouldn't be too difficult to come up with (famous last words), something like /this/".