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

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

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

origin: org.apache.lucene/lucene-core

 @Override
 public final boolean lessThan(PostingsEnum a, PostingsEnum b) {
  return a.docID() < b.docID();
 }
}
origin: org.apache.lucene/lucene-core

@Override
public int docID() {
 return postingsEnum.docID();
}
origin: org.apache.lucene/lucene-core

@Override
public int docID() {
 return in.docID();
}
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: org.apache.lucene/lucene-core

@Override
public int docID() {
 return docsQueue.top().docID();
}
origin: org.apache.lucene/lucene-core

@Override
public int advance(int target) throws IOException {
 PostingsEnum top = docsQueue.top();
 do {
  top.advance(target);
  top = docsQueue.updateTop();
 } while (top.docID() < target);
 return top.docID();
}
origin: org.apache.lucene/lucene-core

@Override
public float score() throws IOException {
 assert docID() != DocIdSetIterator.NO_MORE_DOCS;
 return docScorer.score(postingsEnum.docID(), postingsEnum.freq());
}
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: oracle/opengrok

++n;
Document doc = reader.document(postsIter.docID(), CHECK_FIELDS);
if (doc == null) {
  LOGGER.log(Level.FINER, "No Document: {0}", path);
origin: org.apache.lucene/lucene-core

@Override
public int freq() throws IOException {
 int doc = docID();
 if (doc == posQueueDoc) {
  return freq;
 }
 freq = 0;
 started = false;
 posQueue.clear();
 for (PostingsAndPosition pp : subs) {
  if (pp.pe.docID() == doc) {
   pp.pos = pp.pe.nextPosition();
   pp.upto = pp.pe.freq();
   posQueue.add(pp);
   freq += pp.upto;
  }
 }
 return freq;
}
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

@Override
public int freq() throws IOException {
 int doc = docID();
 if (doc != posQueueDoc) {
  posQueue.clear();
  for (PostingsEnum sub : subs) {
   if (sub.docID() == doc) {
    int freq = sub.freq();
    for (int i = 0; i < freq; i++) {
     posQueue.add(sub.nextPosition());
    }
   }
  }
  posQueue.sort();
  posQueueDoc = doc;
 }
 return posQueue.size();
}
origin: org.elasticsearch/elasticsearch

@Override
public int docID() {
  return postings.docID();
}
origin: org.elasticsearch/elasticsearch

@Override
public float score() throws IOException {
  return payloadBoost() * docScorer.score(postings.docID(), postings.freq());
}
origin: org.apache.lucene/lucene-sandbox

 @Override
 protected boolean lessThan(EnumAndScorer a, EnumAndScorer b) {
  return a.posEnum.docID() < b.posEnum.docID();
 }
}
origin: org.apache.lucene/lucene-queries

 @Override
 public boolean advanceExact(int doc) throws IOException {
  if (pe.docID() > doc)
   return false;
  return pe.docID() == doc || pe.advance(doc) == doc;
 }
};
origin: org.apache.lucene/lucene-sandbox

private void reset() throws IOException {
 if (pe.docID() == NO_MORE_DOCS) {
  upto = -1;
  pos = NO_MORE_INTERVALS;
 }
 else {
  upto = pe.freq();
  pos = -1;
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

@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: org.infinispan/infinispan-embedded-query

@Override
public int advance(int target) throws IOException {
 PostingsEnum top = docsQueue.top();
 
 do {
  top.advance(target);
  top = docsQueue.updateTop();
 } while (top.docID() < target);
 return top.docID();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

@Override
public int advance(int target) throws IOException {
 PostingsEnum top = docsQueue.top();
 do {
  top.advance(target);
  top = docsQueue.updateTop();
 } while (top.docID() < target);
 return top.docID();
}
org.apache.lucene.indexPostingsEnumdocID

Popular methods of PostingsEnum

  • nextDoc
  • 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
  • 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
  • Top PhpStorm 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