@Override public int startOffset() throws IOException { return current.startOffset(); }
@Override public int startOffset() throws IOException { return postings[0].postings.startOffset(); }
@Override public int startOffset() throws IOException { return in.startOffset(); }
@Override public int startOffset() throws IOException { return current.postings.startOffset(); }
@Override public int startOffset() throws IOException { return pe.startOffset(); }
@Override public int startOffset() throws IOException { // when a match is detected, the top postings is advanced until it has moved // beyond its successor, to ensure that the match is of minimal width. This // means that we need to record the lead offset before it is advanced. // However, the priority queue doesn't guarantee that the top postings is in fact the // earliest in the list, so we need to cycle through all terms to check // this is slow, but Matches is slow anyway... int leadOffset = this.leadOffset; for (PhrasePositions pp : phrasePositions) { leadOffset = Math.min(leadOffset, pp.postings.startOffset()); } return leadOffset; }
private void captureLead(PhrasePositions pp) throws IOException { if (captureLeadMatch == false) { return; } leadOrd = pp.ord; leadPosition = pp.position + pp.offset; leadOffset = pp.postings.startOffset(); leadEndOffset = pp.postings.endOffset(); }
@Override public int startOffset() throws IOException { return posQueue.top().pe.startOffset(); }
int startOffset = postings.startOffset(); int endOffset = postings.endOffset(); int startOffset = postings.startOffset(); int endOffset = postings.endOffset();
final int startOffset = postings.startOffset(); final int endOffset = postings.endOffset(); int postingsStartOffset = postingsDocs.startOffset(); int postingsEndOffset = postingsDocs.endOffset(); if (startOffset != postingsStartOffset) {
private void addPositions(final PostingsEnum in, final IndexOutput out) throws IOException { int freq = in.freq(); out.writeVInt(freq); int previousPosition = 0; int previousEndOffset = 0; for (int i = 0; i < freq; i++) { final int pos = in.nextPosition(); final BytesRef payload = in.getPayload(); // The low-order bit of token is set only if there is a payload, the // previous bits are the delta-encoded position. final int token = (pos - previousPosition) << 1 | (payload == null ? 0 : 1); out.writeVInt(token); previousPosition = pos; if (storeOffsets) { // don't encode offsets if they are not stored final int startOffset = in.startOffset(); final int endOffset = in.endOffset(); out.writeVInt(startOffset - previousEndOffset); out.writeVInt(endOffset - startOffset); previousEndOffset = endOffset; } if (payload != null) { out.writeVInt(payload.length); out.writeBytes(payload.bytes, payload.offset, payload.length); } } }
final int startOffset = docsAndPositionsEnum.startOffset(); final int endOffset = docsAndPositionsEnum.endOffset();
int endOffset; if (writeOffsets) { startOffset = postingsEnum.startOffset(); endOffset = postingsEnum.endOffset(); } else {
final int startOffset = docsAndPositionsEnum.startOffset(); final int endOffset = docsAndPositionsEnum.endOffset();
private void initValues(Terms curTerms, PostingsEnum posEnum, int termFreq) throws IOException { for (int j = 0; j < termFreq; j++) { int nextPos = posEnum.nextPosition(); if (curTerms.hasPositions()) { currentPositions[j] = nextPos; } if (curTerms.hasOffsets()) { currentStartOffset[j] = posEnum.startOffset(); currentEndOffset[j] = posEnum.endOffset(); } if (curTerms.hasPayloads()) { BytesRef curPayload = posEnum.getPayload(); if (curPayload != null) { currentPayloads[j] = new BytesArray(curPayload.bytes, 0, curPayload.length); } else { currentPayloads[j] = null; } } } }
@Override public int startOffset() throws IOException { return pe.startOffset(); }
@Override public int startOffset() throws IOException { return postings[0].postings.startOffset(); }
@Override public int startOffset() throws IOException { return current.postings.startOffset(); }
@Override public int startOffset() throws IOException { return current.startOffset(); }
private PostingsEnum writeTermWithDocsAndPos(TermsEnum iterator, PostingsEnum docsAndPosEnum, boolean positions, boolean offsets, boolean payloads) throws IOException { docsAndPosEnum = iterator.postings(docsAndPosEnum, PostingsEnum.ALL); // for each term (iterator next) in this field (field) // iterate over the docs (should only be one) int nextDoc = docsAndPosEnum.nextDoc(); assert nextDoc != DocIdSetIterator.NO_MORE_DOCS; final int freq = docsAndPosEnum.freq(); writeFreq(freq); for (int j = 0; j < freq; j++) { int curPos = docsAndPosEnum.nextPosition(); if (positions) { writePosition(curPos); } if (offsets) { writeOffsets(docsAndPosEnum.startOffset(), docsAndPosEnum.endOffset()); } if (payloads) { writePayload(docsAndPosEnum.getPayload()); } } nextDoc = docsAndPosEnum.nextDoc(); assert nextDoc == DocIdSetIterator.NO_MORE_DOCS; return docsAndPosEnum; }