Tabnine Logo
TermsEnum.term
Code IndexAdd Tabnine to your IDE (free)

How to use
term
method
in
org.apache.lucene.index.TermsEnum

Best Java code snippets using org.apache.lucene.index.TermsEnum.term (Showing top 20 results out of 333)

origin: org.apache.lucene/lucene-core

@Override
public BytesRef term() throws IOException {
 return tenum.term();
}
origin: org.apache.lucene/lucene-core

 TermAndState(String field, TermsEnum termsEnum) throws IOException {
  this.field = field;
  this.termsEnum = termsEnum;
  this.term = BytesRef.deepCopyOf(termsEnum.term());
  this.state = termsEnum.termState();
  this.docFreq = termsEnum.docFreq();
  this.totalTermFreq = termsEnum.totalTermFreq();
 }
}
origin: org.apache.lucene/lucene-core

@Override
public BytesRef term() throws IOException {
 return actualEnum.term();
}
origin: org.apache.lucene/lucene-core

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

@Override
public BytesRef lookupOrd(int ord) throws IOException {
 termsEnum.seekExact(ord);
 return termsEnum.term();
}
origin: org.apache.lucene/lucene-core

@Override
public BytesRef lookupOrd(long ord) throws IOException {
 termsEnum.seekExact(ord);
 return termsEnum.term();
}
origin: oracle/opengrok

public void listTokens(int freq) throws IOException {
  IndexReader ireader = null;
  TermsEnum iter = null;
  Terms terms;
  try {
    ireader = DirectoryReader.open(indexDirectory);
    int numDocs = ireader.numDocs();
    if (numDocs > 0) {
      Fields uFields = MultiFields.getFields(ireader);//reader.getTermVectors(0);
      terms = uFields.terms(QueryBuilder.DEFS);
      iter = terms.iterator(); // init uid iterator
    }
    while (iter != null && iter.term() != null) {
      //if (iter.term().field().startsWith("f")) {
      if (iter.docFreq() > 16 && iter.term().utf8ToString().length() > freq) {
        LOGGER.warning(iter.term().utf8ToString());
      }
      BytesRef next = iter.next();
      if (next==null) {iter=null;}
    }
  } finally {
    if (ireader != null) {
      try {
        ireader.close();
      } catch (IOException e) {
        LOGGER.log(Level.WARNING, "An error occurred while closing index reader", e);
      }
    }
  }
}
origin: oracle/opengrok

while (iter != null && iter.term() != null) {
  files.add(Util.uid2url(iter.term().utf8ToString()));
  BytesRef next = iter.next();
  if (next == null) {
origin: oracle/opengrok

/**
 * Remove a stale file (uidIter.term().text()) from the index database and
 * history cache, and queue the removal of xref.
 *
 * @param removeHistory if false, do not remove history cache for this file
 * @throws java.io.IOException if an error occurs
 */
private void removeFile(boolean removeHistory) throws IOException {
  String path = Util.uid2url(uidIter.term().utf8ToString());
  for (IndexChangedListener listener : listeners) {
    listener.fileRemove(path);
  }
  writer.deleteDocuments(new Term(QueryBuilder.U, uidIter.term()));
  removeXrefFile(path);
  if (removeHistory) {
    removeHistoryFile(path);
  }
  setDirty();
  for (IndexChangedListener listener : listeners) {
    listener.fileRemoved(path);
  }
}
origin: oracle/opengrok

while (uidIter != null && uidIter.term() != null
    && uidIter.term().compareTo(emptyBR) != 0
    && uidIter.term().compareTo(buid) < 0) {
  String termPath = Util.uid2url(uidIter.term().utf8ToString());
  removeFile(!termPath.equals(path));
if (uidIter != null && uidIter.term() != null &&
    uidIter.term().bytesEquals(buid)) {
origin: oracle/opengrok

while (uidIter != null && uidIter.term() != null
  && uidIter.term().utf8ToString().startsWith(startuid)) {
origin: org.apache.lucene/lucene-core

actualTerm = tenum.term();
origin: org.apache.lucene/lucene-core

 term = termsEnum.next();
} else {
 term = termsEnum.term();
origin: org.apache.lucene/lucene-core

current = currentSubs[i].current = currentSubs[i].terms.term();
assert term.equals(currentSubs[i].current);
origin: org.apache.lucene/lucene-core

 throw new RuntimeException("seek to last term " + lastTerm.get() + " failed");
if (termsEnum.term().equals(lastTerm.get()) == false) {
 throw new RuntimeException("seek to last term " + lastTerm.get() + " returned FOUND but seeked to the wrong term " + termsEnum.term());
   throw new RuntimeException("seek to ord " + ord + " returned ord " + actualOrd);
  seekTerms[i] = BytesRef.deepCopyOf(termsEnum.term());
   throw new RuntimeException("seek to existing term " + seekTerms[i] + " failed");
  if (termsEnum.term().equals(seekTerms[i]) == false) {
   throw new RuntimeException("seek to existing term " + seekTerms[i] + " returned FOUND but seeked to the wrong term " + termsEnum.term());
origin: org.apache.lucene/lucene-core

 current = currentSubs[i].current = currentSubs[i].terms.term();
 queue.add(currentSubs[i]);
} else {
 if (status == SeekStatus.NOT_FOUND) {
  currentSubs[i].current = currentSubs[i].terms.term();
  assert currentSubs[i].current != null;
  queue.add(currentSubs[i]);
origin: org.apache.lucene/lucene-core

 readerTerm = termsEnum.term();
 continue;
} else {
origin: org.apache.lucene/lucene-core

startTerm(termsEnum.term(), freq);
origin: org.apache.lucene/lucene-core

writer.startTerm(termsEnum.term(), freq);
origin: org.apache.lucene/lucene-core

 TermsEnum iterator = iterator();
 iterator.seekExact(size - 1);
 return iterator.term();
} catch (UnsupportedOperationException e) {
org.apache.lucene.indexTermsEnumterm

Javadoc

Returns current term. Do not call this when the enum is unpositioned.

Popular methods of TermsEnum

  • next
  • docFreq
    Returns the number of documents containing the current term. Do not call this when the enum is unpos
  • totalTermFreq
    Returns the total number of occurrences of this term across all documents (the sum of the freq() for
  • seekExact
  • postings
  • seekCeil
    Seeks to the specified term, if it exists, or to the next (ceiling) term. Returns SeekStatus to indi
  • ord
    Returns ordinal position for current term. This is an optional method (the codec may throw Unsupport
  • attributes
    Returns the related attributes.
  • termState
    Expert: Returns the TermsEnums internal state to position the TermsEnum without re-seeking the term
  • docs
    Get DocsEnum for the current term, with control over whether freqs are required. Do not call this wh
  • docsAndPositions
    Get DocsAndPositionsEnum for the current term, with control over whether offsets and payloads are re
  • getComparator
  • docsAndPositions,
  • getComparator,
  • docfreq

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Github Copilot alternatives
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