private boolean advanceOneTo(int docId, int index) {
        int i = sortedIndexes[index];
        PostingList postingList = postingLists[i];
        if (postingList.nextDocument(docId - 1)) {
            docIds[i] = postingList.getDocId();
            return true;
        }
        docIds[i] = Integer.MAX_VALUE;  // will be last after sorting.
        return false;
    }
Returns the end value of the interval,
or -1 if the highest end value seen is less than the interval begin.
predicate-search/src/main/java/com/yahoo/search/predicate/index/PredicateSearch.java