Tabnine Logo
PostingsEnum.nextDoc
Code IndexAdd Tabnine to your IDE (free)

How to use
nextDoc
method
in
org.apache.lucene.index.PostingsEnum

Best Java code snippets using org.apache.lucene.index.PostingsEnum.nextDoc (Showing top 20 results out of 315)

origin: org.apache.lucene/lucene-core

@Override
public int nextDoc() throws IOException {
 return in.nextDoc();
}
origin: org.apache.lucene/lucene-core

@Override
public int nextDoc() throws IOException {
 while(true) {
  if (current == null) {
   if (upto == numSubs-1) {
    return this.doc = NO_MORE_DOCS;
   } else {
    upto++;
    current = subs[upto].postingsEnum;
    currentBase = subs[upto].slice.start;
   }
  }
  final int doc = current.nextDoc();
  if (doc != NO_MORE_DOCS) {
   return this.doc = currentBase + doc;
  } else {
   current = null;
  }
 }
}
origin: org.apache.lucene/lucene-core

 @Override
 public int nextDoc() {
  try {
   return postings.nextDoc();
  } catch (IOException ioe) {
   throw new RuntimeException(ioe);
  }
 }
}
origin: org.apache.lucene/lucene-core

@Override
public int nextDoc() throws IOException {
 doc = postings.nextDoc();
 if (doc != DocIdSetIterator.NO_MORE_DOCS) {
  freq = postings.freq();
  assert freq >= 1;
  count = 0;
 }
 position = -1;
 return doc;
}
origin: org.apache.lucene/lucene-core

@Override
public int advance(int target) throws IOException {
 assert target > doc;
 while(true) {
  if (current != null) {
   final int doc;
   if (target < currentBase) {
    // target was in the previous slice but there was no matching doc after it
    doc = current.nextDoc();
   } else {
    doc = current.advance(target-currentBase);
   }
   if (doc == NO_MORE_DOCS) {
    current = null;
   } else {
    return this.doc = doc + currentBase;
   }
  } else if (upto == numSubs-1) {
   return this.doc = NO_MORE_DOCS;
  } else {
   upto++;
   current = subs[upto].postingsEnum;
   currentBase = subs[upto].slice.start;
  }
 }
}
origin: oracle/opengrok

private int getDocumentFrequency(final IntsHolder documentIds, final int docBase, final PostingsEnum postingsEnum)
    throws IOException {
  int weight = 0;
  while (postingsEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
    if (documentIds.has(docBase + postingsEnum.docID())) {
      weight++;
    }
  }
  return normalizeDocumentFrequency(weight, documentIds.numberOfElements());
}
origin: org.apache.lucene/lucene-core

@Override
public int nextDoc() throws IOException {
 PostingsEnum top = docsQueue.top();
 int doc = top.docID();
 do {
  top.nextDoc();
  top = docsQueue.updateTop();
 } while (top.docID() == doc);
 return top.docID();
}
origin: oracle/opengrok

while (postsIter.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
  ++n;
origin: org.apache.lucene/lucene-core

assert delDocLimit < PostingsEnum.NO_MORE_DOCS;
while (true) {
 int doc = postingsEnum.nextDoc();
 if (doc < delDocLimit) {
  if (state.liveDocs == null) {
origin: oracle/opengrok

private int getPhraseScore(final ComplexQueryData data, final int docBase, final PostingsEnum postingsEnum)
    throws IOException {
  int weight = 0;
  while (postingsEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
    int docId = postingsEnum.docID();
    if (data.documentIds.has(docBase + docId)) {
      IntsHolder positions = data.scorer.getPositions(docBase + docId);
      if (positions == null) {
        continue;
      }
      int freq = postingsEnum.freq();
      for (int i = 0; i < freq; i++) {
        int pos = postingsEnum.nextPosition();
        if (positions.has(pos)) {
          weight++;
        }
      }
    }
  }
  return weight;
}
origin: org.apache.lucene/lucene-core

 freqs = new int[docs.length];
while ((doc = in.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS){
 if (i >= docs.length) {
  docs = ArrayUtil.grow(docs, docs.length + 1);
while ((doc = in.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS){
 if (i >= docs.length) {
  docs = ArrayUtil.grow(docs, docs.length + 1);
origin: org.apache.lucene/lucene-core

int doc = postingsEnum.nextDoc();
if (doc == DocIdSetIterator.NO_MORE_DOCS) {
 break;
origin: org.apache.lucene/lucene-core

long totalTermFreq = 0;
while(true) {
 final int doc = postings.nextDoc();
 if (doc == DocIdSetIterator.NO_MORE_DOCS) {
  break;
   final int nextDocID = postings.nextDoc();
   if (nextDocID == DocIdSetIterator.NO_MORE_DOCS) {
    break;
    throw new RuntimeException("term " + term + ": advance(docID=" + skipDocID + ") returned docID=" + docID);
   final int nextDocID = postings.nextDoc();
   if (nextDocID == DocIdSetIterator.NO_MORE_DOCS) {
    break;
 PostingsEnum d = termsEnum.postings(null, PostingsEnum.NONE);
 int docFreq = 0;
 while (d.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
  docFreq++;
origin: org.apache.lucene/lucene-core

final int doc = postings.nextDoc();
origin: org.apache.lucene/lucene-core

while ((docID = postingsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
origin: org.apache.lucene/lucene-core

while ((doc = postingsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
 if (acceptDocs == null || acceptDocs.get(doc)) {
while ((doc = postingsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
 if (doc >= limit) {
  break; // no more docs that can be updated for this term
origin: org.apache.lucene/lucene-core

long totalTermFreq = 0;
while (true) {
 int docID = postingsEnum.nextDoc();
 if (docID == PostingsEnum.NO_MORE_DOCS) {
  break;
origin: org.apache.lucene/lucene-core

assert docsAndPositionsEnum != null;
final int docID = docsAndPositionsEnum.nextDoc();
assert docID != DocIdSetIterator.NO_MORE_DOCS;
assert docsAndPositionsEnum.freq() == freq;
origin: org.apache.lucene/lucene-core

assert docsAndPositionsEnum != null;
final int docID = docsAndPositionsEnum.nextDoc();
assert docID != DocIdSetIterator.NO_MORE_DOCS;
assert docsAndPositionsEnum.freq() == freq;
origin: org.apache.lucene/lucene-core

int doc;
int i = 0;
while ((doc = in.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
 if (i == docs.length) {
  final int newLength = ArrayUtil.oversize(i + 1, 4);
org.apache.lucene.indexPostingsEnumnextDoc

Popular methods of PostingsEnum

  • freq
    Returns term frequency in the current document, or 1 if the field was indexed with IndexOptions#DOCS
  • nextPosition
    Returns the next position, or -1 if positions were not indexed. Calling this more than #freq() times
  • docID
  • endOffset
    Returns end offset for the current position, or -1 if offsets were not indexed.
  • startOffset
    Returns start offset for the current position, or -1 if offsets were not indexed.
  • advance
  • getPayload
    Returns the payload at this position, or null if no payload was indexed. You should not modify anyth
  • featureRequested
    Returns true if the given feature is requested in the flags, false otherwise.
  • cost
  • attributes
    Returns the related attributes.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JButton (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now