Hi all,
Since all elements in the SET are retrieved for later sort, and while retrieving elements, each element is associated with an initial score (which is 0 by default), thus, when it fails to match a hash by the given pattern, the score is left to be 0, but when we have values from negative to positive, the unmatched element will sit in the middle of the results, which is not reasonable in many cases.
E.g.,
SET: set1 (“1”, “2”, “3”, “4”, “5”)
Hashes : h1->f1=10, h2->f1=-10
SORT: sort set1 by h_->f1 get # get h_->f1
results: "2" -10, "3" nil, "4" nil, "5" nil, "1" 10
what do you think of this, is it a defect ?
In my case, it is definitely not reasonable. my temporary solution is when it fails to match:
vector[j].u.score = (desc ? 0 - DBL_MAX: DBL_MAX);
continue;
Thanks,