Example usage for org.apache.lucene.search PhrasePositions nextPosition

List of usage examples for org.apache.lucene.search PhrasePositions nextPosition

Introduction

In this page you can find the example usage for org.apache.lucene.search PhrasePositions nextPosition.

Prototype

final boolean nextPosition() throws IOException 

Source Link

Document

Go to next location of this term current document, and set position as location - offset, so that a matching exact phrase is easily identified when all PhrasePositions have exactly the same position.

Usage

From source file:org.opengrok.suggest.query.customized.CustomSloppyPhraseScorer.java

License:Apache License

/** advance a PhrasePosition and update 'end', return false if exhausted */
private boolean advancePP(PhrasePositions pp) throws IOException {
    if (!pp.nextPosition()) {
        return false;
    }//from w w w  .  j  av  a  2  s.c o  m
    if (pp.position > end) {
        end = pp.position;
    }
    return true;
}