congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
org.apache.lucene.util
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.lucene.util

Best Java code snippets using org.apache.lucene.util (Showing top 20 results out of 1,467)

origin: neo4j/neo4j

  @Override
  protected boolean match( int doc )
  {
    return liveDocs.get( doc );
  }
};
origin: neo4j/neo4j

  @Override
  protected AcceptStatus accept( BytesRef term )
  {
    return StringHelper.startsWith( term, prefix ) ? AcceptStatus.YES : AcceptStatus.END;
  }
}
origin: neo4j/neo4j

  /** Return the {@see DocIdSet} which contains all the recorded docs. */
  public DocIdSet getDocIdSet()
  {
    return bits.build();
  }
}
origin: org.apache.lucene/lucene-core

 @Override
 public int compare(ScoreTerm st1, ScoreTerm st2) {
  return st1.bytes.get().compareTo(st2.bytes.get());
 }
};
origin: org.apache.lucene/lucene-core

@Override
public PayloadAttributeImpl clone()  {
 PayloadAttributeImpl clone = (PayloadAttributeImpl) super.clone();
 if (payload != null) {
  clone.payload = BytesRef.deepCopyOf(payload);
 }
 return clone;
}
origin: org.apache.lucene/lucene-core

@Override
public int[] init() {
 final int[] ord = super.init();
 boost = new float[ArrayUtil.oversize(ord.length, Float.BYTES)];
 termState = new TermContext[ArrayUtil.oversize(ord.length, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];
 assert termState.length >= ord.length && boost.length >= ord.length;
 return ord;
}
origin: org.apache.lucene/lucene-core

/**
 * Augments an existing accountable with the provided description.
 * <p>
 * The resource description is constructed in this format:
 * {@code description [toString()]}
 * <p>
 * This is a point-in-time type safe view: consumers 
 * will not be able to cast or manipulate the resource in any way.
 */
public static Accountable namedAccountable(String description, Accountable in) {
 return namedAccountable(description + " [" + in + "]", in.getChildResources(), in.ramBytesUsed());
}

origin: org.apache.lucene/lucene-core

/**
 * Creates a new {@link BytesRefArray} with a counter to track allocated bytes
 */
public BytesRefArray(Counter bytesUsed) {
 this.pool = new ByteBlockPool(new ByteBlockPool.DirectTrackingAllocator(
   bytesUsed));
 pool.nextBuffer();
 bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_ARRAY_HEADER * Integer.BYTES);
 this.bytesUsed = bytesUsed;
}
origin: org.apache.lucene/lucene-core

/**
 * Creates a new CharsRef that points to a copy of the chars from 
 * <code>other</code>
 * <p>
 * The returned CharsRef will have a length of other.length
 * and an offset of zero.
 */
public static CharsRef deepCopyOf(CharsRef other) {
 return new CharsRef(ArrayUtil.copyOfSubArray(other.chars, other.offset, other.offset + other.length), 0, other.length);
}

origin: org.apache.lucene/lucene-core

@Override
public CharSequence subSequence(int start, int end) {
 // NOTE: must do a real check here to meet the specs of CharSequence
 FutureObjects.checkFromToIndex(start, end, length);
 return new CharsRef(chars, offset + start, end - start);
}

origin: org.apache.lucene/lucene-core

 @Override
 public State clone() {
  State clone = new State();
  clone.attribute = attribute.clone();
  
  if (next != null) {
   clone.next = next.clone();
  }
  
  return clone;
 }
}
origin: neo4j/neo4j

Docs( int maxDoc )
{
  bits = new DocIdSetBuilder( maxDoc );
}
origin: org.apache.lucene/lucene-core

/**
 * Creates a new LongsRef that points to a copy of the longs from 
 * <code>other</code>
 * <p>
 * The returned IntsRef will have a length of other.length
 * and an offset of zero.
 */
public static LongsRef deepCopyOf(LongsRef other) {
 return new LongsRef(ArrayUtil.copyOfSubArray(other.longs, other.offset, other.offset + other.length), 0, other.length);
}

origin: org.apache.lucene/lucene-core

/**
 * Copy the given UTF-8 bytes into this builder. Works as if the bytes were
 * first converted from UTF-8 to UTF-32 and then copied into this builder.
 */
public void copyUTF8Bytes(BytesRef bytes) {
 grow(bytes.length);
 ref.length = UnicodeUtil.UTF8toUTF32(bytes, ref.ints);
}
origin: org.apache.lucene/lucene-core

@Override
public final void sort(int from, int to) {
 checkRange(from, to);
 quicksort(from, to, 2 * MathUtil.log(to - from, 2));
}
origin: neo4j/neo4j

/** Record the given document. */
public void addDoc( int docId )
{
  bits.add( docId );
}
origin: org.apache.lucene/lucene-core

void grow(int newBlockCount) {
 ramBytesUsed -= RamUsageEstimator.shallowSizeOf(values);
 values = ArrayUtil.growExact(values, newBlockCount);
 ramBytesUsed += RamUsageEstimator.shallowSizeOf(values);
}
origin: org.apache.lucene/lucene-core

/**
 * Resets all Attributes in this AttributeSource by calling
 * {@link AttributeImpl#clear()} on each Attribute implementation.
 */
public final void clearAttributes() {
 for (State state = getCurrentState(); state != null; state = state.next) {
  state.attribute.clear();
 }
}

origin: org.apache.lucene/lucene-core

/**
 * Captures the state of all Attributes. The return value can be passed to
 * {@link #restoreState} to restore the state of this or another AttributeSource.
 */
public final State captureState() {
 final State state = this.getCurrentState();
 return (state == null) ? null : state.clone();
}

origin: org.apache.lucene/lucene-core

/** Build an instance. */
public RoaringDocIdSet build() {
 flush();
 return new RoaringDocIdSet(sets, cardinality);
}
org.apache.lucene.util

Most used classes

  • BytesRef
    Represents byte[], as a slice (offset + length) into an existing byte[]. The #bytes member should ne
  • Bits
    Interface for Bitset-like structures.
  • NumericUtils
    This is a helper class to generate prefix-encoded representations for numerical values and supplies
  • IOUtils
    This class emulates the new Java 7 "Try-With-Resources" statement. Remove once Lucene is on Java 7.
  • ArrayUtil
    Methods for manipulating arrays.
  • BytesRefBuilder,
  • FixedBitSet,
  • PriorityQueue,
  • OpenBitSet,
  • AttributeReflector,
  • StringHelper,
  • FST,
  • AttributeSource,
  • IntsRef,
  • UnicodeUtil,
  • FST$Arc,
  • Builder,
  • Outputs,
  • BytesRefHash
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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