Tabnine Logo
Term.compareTo
Code IndexAdd Tabnine to your IDE (free)

How to use
compareTo
method
in
org.apache.lucene.index.Term

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

origin: org.apache.lucene/lucene-core

 @Override
 protected int compare(int i, int j) {
  return terms[i].compareTo(terms[j]);
 }
}.sort(0, terms.length);
origin: oracle/opengrok

@Override
public int compareTo(PostingsAndFreq other) {
  if (position != other.position) {
    return position - other.position;
  }
  if (nTerms != other.nTerms) {
    return nTerms - other.nTerms;
  }
  if (nTerms == 0) {
    return 0;
  }
  for (int i=0; i<terms.length; i++) {
    int res = terms[i].compareTo(other.terms[i]);
    if (res!=0) {
      return res;
    }
  }
  return 0;
}
origin: org.apache.lucene/lucene-core

@Override
public int compareTo(PostingsAndFreq other) {
 if (position != other.position) {
  return position - other.position;
 }
 if (nTerms != other.nTerms) {
  return nTerms - other.nTerms;
 }
 if (nTerms == 0) {
  return 0;
 }
 for (int i=0; i<terms.length; i++) {
  int res = terms[i].compareTo(other.terms[i]);
  if (res!=0) return res;
 }
 return 0;
}
origin: tjake/Solandra

public ConcurrentNavigableMap<Term, LucandraTermInfo[]> skipTo(Term skip) throws IOException
{
  Pair<Term, Term> range = null;
  int bufferSize = termList.isEmpty() ? 1 : 3;
  // verify we've buffered sufficiently
  Map.Entry<Term, Pair<Term, Term>> tailEntry = termQueryBoundries.ceilingEntry(skip);
  boolean needsBuffering = true;
  if (tailEntry != null)
  {
    range = tailEntry.getValue();           
    
    //skip term must be within a buffered range avoid rebuffering
    if (skip.compareTo(range.left) >= 0 && (!range.right.equals(emptyTerm) && skip.compareTo(range.right) < 0))
    {                
      needsBuffering = false;
    }
  }
  ConcurrentNavigableMap<Term, LucandraTermInfo[]> subList = emptyMap;
  if (needsBuffering)
  {
    range = bufferTerms(skip, bufferSize);
  }
  //logger.info(Thread.currentThread().getName()+" rebuffered "+needsBuffering+" "+range);
  
  if (skip.compareTo(range.left) >= 0 && (!range.right.equals(emptyTerm)) && skip.compareTo(range.right) <= 0)
  {
    subList = termList.subMap(skip, true, range.right, true);
  }
  return subList;
}
origin: tjake/Solandra

if(queryRange.right == null || queryRange.right.compareTo(term) < 0)
  queryRange.right = term;
origin: org.apache.lucene/lucene-core

/** add a term.  This fully consumes in the incoming {@link BytesRef}. */
public void add(String field, BytesRef bytes) {
 assert lastTerm.equals(new Term("")) || new Term(field, bytes).compareTo(lastTerm) > 0;
 try {
  final int prefix;
  if (size > 0 && field.equals(lastTerm.field)) {
   // same field as the last term
   prefix = StringHelper.bytesDifference(lastTerm.bytes, bytes);
   output.writeVInt(prefix << 1);
  } else {
   // field change
   prefix = 0;
   output.writeVInt(1);
   output.writeString(field);
  }
  int suffix = bytes.length - prefix;
  output.writeVInt(suffix);
  output.writeBytes(bytes.bytes, bytes.offset + prefix, suffix);
  lastTermBytes.copyBytes(bytes);
  lastTerm.bytes = lastTermBytes.get();
  lastTerm.field = field;
  size += 1;
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
}

origin: linkedin/indextank-engine

do {
  Term term = terms.term();
  if (term.compareTo(rightBoundary) >= 0) {
    break;
origin: org.apache.jackrabbit/jackrabbit-core

protected boolean termCompare(Term term) {
  int compare = term.compareTo(upper);
  if (compare > 0) {
    endEnum = true;
  }
  return compare <= 0;
}
origin: org.exoplatform.jcr/exo.jcr.component.core

protected boolean termCompare(Term term) {
  int compare = term.compareTo(upper);
  if (compare > 0) {
    endEnum = true;
  }
  return compare <= 0;
}
origin: org.apache.lucene/com.springsource.org.apache.lucene

protected boolean lessThan(Object a, Object b) {
 ScoreTerm termA = (ScoreTerm)a;
 ScoreTerm termB = (ScoreTerm)b;
 if (termA.score == termB.score)
  return termA.term.compareTo(termB.term) > 0;
 else
  return termA.score < termB.score;
}

origin: org.apache.lucene/lucene-core-jfrog

protected final boolean lessThan(Object a, Object b) {
 SegmentMergeInfo stiA = (SegmentMergeInfo)a;
 SegmentMergeInfo stiB = (SegmentMergeInfo)b;
 int comparison = stiA.term.compareTo(stiB.term);
 if (comparison == 0)
  return stiA.base < stiB.base; 
 else
  return comparison < 0;
}
origin: org.apache.lucene/lucene-classification

@Override
protected boolean lessThan(ScoreTerm termA, ScoreTerm termB) {
 if (termA.score == termB.score)
  return termA.term.compareTo(termB.term) > 0;
 else
  return termA.score < termB.score;
}
origin: org.infinispan/infinispan-embedded-query

 @Override
 protected int compare(int i, int j) {
  return terms[i].compareTo(terms[j]);
 }
}.sort(0, terms.length);
origin: org.apache.lucene/lucene-core-jfrog

protected boolean lessThan(Object a, Object b) {
 ScoreTerm termA = (ScoreTerm)a;
 ScoreTerm termB = (ScoreTerm)b;
 if (termA.score == termB.score)
  return termA.term.compareTo(termB.term) > 0;
 else
  return termA.score < termB.score;
}

origin: apache/jackrabbit

protected boolean termCompare(Term term) {
  int compare = term.compareTo(upper);
  if (compare > 0) {
    endEnum = true;
  }
  return compare <= 0;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

 @Override
 protected int compare(int i, int j) {
  return terms[i].compareTo(terms[j]);
 }
}.sort(0, terms.length);
origin: org.apache.lucene/com.springsource.org.apache.lucene

protected final boolean lessThan(Object a, Object b) {
 SegmentMergeInfo stiA = (SegmentMergeInfo)a;
 SegmentMergeInfo stiB = (SegmentMergeInfo)b;
 int comparison = stiA.term.compareTo(stiB.term);
 if (comparison == 0)
  return stiA.base < stiB.base; 
 else
  return comparison < 0;
}
origin: org.apache.lucene/lucene-sandbox

@Override
protected boolean lessThan(ScoreTerm termA, ScoreTerm termB) {
 if (termA.score== termB.score)
  return termA.term.compareTo(termB.term) > 0;
 else
  return termA.score < termB.score;
}
  
origin: harbby/presto-connectors

 @Override
 protected int compare(int i, int j) {
  return terms[i].compareTo(terms[j]);
 }
}.sort(0, terms.length);
origin: lucene/lucene

/** Scans within block for matching term. */
private final TermInfo scanEnum(Term term) throws IOException {
 SegmentTermEnum enumerator = getEnum();
 while (term.compareTo(enumerator.term()) > 0 && enumerator.next()) {}
 if (enumerator.term() != null && term.compareTo(enumerator.term()) == 0)
  return enumerator.termInfo();
 else
  return null;
}
org.apache.lucene.indexTermcompareTo

Javadoc

Compares two terms, returning a negative integer if this term belongs before the argument, zero if this term is equal to the argument, and a positive integer if this term belongs after the argument. The ordering of terms is first by field, then by text.

Popular methods of Term

  • <init>
    Constructs a Term with the given field and the bytes from a builder.Note that a null field value res
  • text
    Returns the text of this term. In the case of words, this is simply the text of the word. In the cas
  • field
    Returns the field of this term, an interned string. The field indicates the part of a document which
  • bytes
    Returns the bytes of this term, these should not be modified.
  • equals
    Compares two terms, returning true iff they have the same field and text.
  • hashCode
    Combines the hashCode() of the field and the text.
  • toString
    Returns human-readable form of the term text. If the term is not unicode, the raw bytes will be prin
  • createTerm
    Optimized construction of new Terms by reusing same field as this Term - avoids field.intern() overh
  • generate
  • getCoeff
  • getEntitiesList
  • getExp
  • getEntitiesList,
  • getExp,
  • getName,
  • getPropertyMap,
  • set,
  • setAbbr1,
  • setAbbr2,
  • setCode,
  • setData

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Top Sublime Text 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