Example #1
0
int32_t
ORScorer_advance(ORScorer *self, int32_t target) {
    // Return sentinel once exhausted.
    if (!self->size) { return 0; }

    // Succeed if we're already past and still on a valid doc.
    if (target <= self->doc_id) {
        return self->doc_id;
    }

    do {
        // If all matchers are caught up, accumulate score and return.
        if (self->top_hmd->doc >= target) {
            return S_advance_after_current(self);
        }

        // Not caught up yet, so keep skipping matchers.
        if (!SI_top_advance((ORMatcher*)self, target)) {
            if (!self->size) { return 0; }
        }
    } while (true);
}
Example #2
0
int32_t
ORScorer_Next_IMP(ORScorer *self) {
    ORScorerIVARS *const ivars = ORScorer_IVARS(self);
    return S_advance_after_current(self, ivars);
}
Example #3
0
int32_t
ORScorer_next(ORScorer *self) {
    return S_advance_after_current(self);
}