Ticket #216: bug216-fix.patch
File bug216-fix.patch, 1.9 KB (added by , 16 years ago) |
---|
-
matcher/multimatch.cc
478 478 bool is_heap = false; 479 479 480 480 while (true) { 481 bool pushback; 482 481 483 if (rare(recalculate_w_max)) { 482 484 if (min_weight > 0.0) { 483 485 if (rare(getorrecalc_maxweight(pl) < min_weight)) { … … 544 546 // processing needed. 545 547 LOGLINE(MATCH, "Making note of match item which sorts lower than min_item"); 546 548 ++docs_matched; 549 if (!calculated_weight) wt = pl->get_weight(); 550 if (wt > greatest_wt) goto new_greatest_weight; 547 551 continue; 548 552 } 549 553 if (docs_matched >= check_at_least) { 550 554 // We've seen enough items - we can drop this one. 551 555 LOGLINE(MATCH, "Dropping candidate which sorts lower than min_item"); 556 // FIXME: hmm, match decider might have rejected this... 557 if (!calculated_weight) wt = pl->get_weight(); 558 if (wt > greatest_wt) goto new_greatest_weight; 552 559 continue; 553 560 } 554 561 // We can't drop the item, because we need to show it … … 590 597 new_item.wt = wt; 591 598 } 592 599 593 boolpushback = true;600 pushback = true; 594 601 documents_considered++; 595 602 596 603 // Perform collapsing on key if requested. … … 623 630 if (new_item.wt > oldkey->second.second) { 624 631 oldkey->second.second = new_item.wt; 625 632 } 633 // If we're sorting by relevance primarily, then we 634 // throw away the lower weighted document anyway. 635 if (sort_by != REL && sort_by != REL_VAL) { 636 if (wt > greatest_wt) goto new_greatest_weight; 637 } 626 638 continue; 627 639 } 628 640 // Make a note of the updated collapse count in the … … 734 746 735 747 // Keep a track of the greatest weight we've seen. 736 748 if (wt > greatest_wt) { 749 new_greatest_weight: 737 750 greatest_wt = wt; 738 751 if (percent_cutoff) { 739 752 Xapian::weight w = wt * percent_cutoff_factor;