C# (CSharp) Lucene.Net.Util Namespace

Nested Namespaces

Lucene.Net.Util.Automaton
Lucene.Net.Util.Cache
Lucene.Net.Util.Fst
Lucene.Net.Util.Packed

Сlasses

Name Description
ArrayUtilTest
BitUtil A variety of high efficiencly bit twiddling routines.
BitsHelpers
Bits_MatchAllBits Bits impl of the specified length with all bits set.
Bits_MatchNoBits Bits impl of the specified length with no bits set.
BytesRefHash BytesRefHash is a special purpose hash-map like data-structure optimized for BytesRef instances. BytesRefHash maintains mappings of byte arrays to ids (Map<BytesRef,int>) storing the hashed bytes efficiently in continuous storage. The mapping to the id is encapsulated inside BytesRefHash and is guaranteed to be increased for each added BytesRef.

Note: The maximum capacity BytesRef instance passed to #add(BytesRef) must not be longer than ByteBlockPool#BYTE_BLOCK_SIZE-2. The internal storage is limited to 2GB total byte storage.

@lucene.internal
BytesRefHash.BytesStartArray Manages allocation of the per-term addresses.
BytesRefHash.DirectBytesStartArray A simple BytesStartArray that tracks memory allocation using a private Counter instance.
BytesRefHash.IntroSorterAnonymousInnerClassHelper
BytesRefHash.MaxBytesLengthExceededException Thrown if a BytesRef exceeds the BytesRefHash limit of ByteBlockPool#BYTE_BLOCK_SIZE-2.
ComparatorAnonymousInnerClassHelper
Date
DocIdBitSet Simple DocIdSet and DocIdSetIterator backed by a BitSet
DocIdBitSet.DocIdBitSetIterator
EmptyBytesRefIterator
English
FieldCacheSanityChecker Provides methods for sanity checking that entries in the FieldCache are not wasteful or inconsistent.

Lucene 2.9 Introduced numerous enhancements into how the FieldCache is used by the low levels of Lucene searching (for Sorting and ValueSourceQueries) to improve both the speed for Sorting, as well as reopening of IndexReaders. But these changes have shifted the usage of FieldCache from "top level" IndexReaders (frequently a MultiReader or DirectoryReader) down to the leaf level SegmentReaders. As a result, existing applications that directly access the FieldCache may find RAM usage increase significantly when upgrading to 2.9 or Later. this class provides an API for these applications (or their Unit tests) to check at run time if the FieldCache contains "insane" usages of the FieldCache.

@lucene.experimental
FieldCacheSanityChecker.Insanity Simple container for a collection of related CacheEntry objects that in conjunction with each other represent some "insane" usage of the FieldCache.
FieldCacheSanityChecker.InsanityType An Enumeration of the different types of "insane" behavior that may be detected in a FieldCache.
FieldCacheSanityChecker.ReaderField Simple pair object for using "readerKey + fieldName" a Map key
FixedBitSet BitSet of fixed length (numBits), backed by accessible (#getBits) long[], accessed with an int index, implementing GetBits and DocIdSet. If you need to manage more than 2.1B bits, use LongBitSet. @lucene.internal
FixedBitSet.FixedBitSetIterator A DocIdSetIterator which iterates over set bits in a FixedBitSet.
LineFileDocs Minimal port of benchmark's LneDocSource + DocMaker, so tests can enum docs from a line file created by benchmark's WriteLineDoc task
LineFileDocs.DocState
LocalizedTestCase Base test class for Lucene test classes that test Locale-sensitive behavior.

This class will run tests under the default Locale, but then will also run tests under all available JVM locales. This is helpful to ensure tests will not fail under a different environment.

LongBitSet BitSet of fixed length (numBits), backed by accessible (#getBits) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet. @lucene.internal
LuceneTestCase
LuceneTestCase.ConcurrentMergeSchedulers Contains a list of all the IConcurrentMergeSchedulers to be tested. LUCENENET specific
LuceneTestCase.RandomBits
LuceneTestCase.SuppressCodecs
LuceneTestCase.SuppressTempFileChecks
MathUtil Math static utility methods.
NamedThreadFactory A default ThreadFactory implementation that accepts the name prefix of the created threads as a constructor argument. Otherwise, this factory yields the same semantics as the thread factory returned by Executors#defaultThreadFactory().
Number A simple class for number conversions.
NumericUtils this is a helper class to generate prefix-encoded representations for numerical values and supplies converters to represent float/double values as sortable integers/longs.

To quickly execute range queries in Apache Lucene, a range is divided recursively into multiple intervals for searching: The center of the range is searched only with the lowest possible precision in the trie, while the boundaries are matched more exactly. this reduces the number of terms dramatically.

this class generates terms to achieve this: First the numerical integer values need to be converted to bytes. For that integer values (32 bit or 64 bit) are made unsigned and the bits are converted to ASCII chars with each 7 bit. The resulting byte[] is sortable like the original integer value (even using UTF-8 sort order). Each value is also prefixed (in the first char) by the shift value (number of bits removed) used during encoding.

To also index floating point numbers, this class supplies two methods to convert them to integer values by changing their bit layout: #doubleToSortableLong, #floatToSortableInt. You will have no precision loss by converting floating point numbers to integers and back (only that the integer form is not usable). Other data types like dates can easily converted to longs or ints (e.g. date to long: java.util.Date#getTime).

For easy usage, the trie algorithm is implemented for indexing inside NumericTokenStream that can index int, long, float, and double. For querying, NumericRangeQuery and NumericRangeFilter implement the query part for the same data types.

this class can also be used, to generate lexicographically sortable (according to BytesRef#getUTF8SortedAsUTF16Comparator()) representations of numeric data types for other usages (e.g. sorting). @lucene.internal @since 2.9, API changed non backwards-compliant in 4.0

NumericUtils.FilteredTermsEnumAnonymousInnerClassHelper
NumericUtils.FilteredTermsEnumAnonymousInnerClassHelper2
NumericUtils.IntRangeBuilder Callback for #splitIntRange. You need to overwrite only one of the methods. @lucene.internal @since 2.9, API changed non backwards-compliant in 4.0
NumericUtils.LongRangeBuilder Callback for #splitLongRange. You need to overwrite only one of the methods. @lucene.internal @since 2.9, API changed non backwards-compliant in 4.0
OfflineSorter.ByteSequencesWriter /// Convenience constant for megabytes
OpenBitSet
OpenBitSetIterator An iterator to iterate over set bits in an OpenBitSet. this is faster than nextSetBit() for iterating over the complete set of bits, especially when the density of the bits set is high.
Parameter
Paths The static accessor class for file paths used in testing.
StressRamUsageEstimator
StressRamUsageEstimator.Entry
StringHelperTest
TestAttributeSource
TestBitVector
TestBroadWord
TestBytesRefHash
TestFieldCacheSanityChecker
TestIdentityHashSet
TestIndexableBinaryStringTools
TestIntroSorter
TestLongBitSet
TestMathUtil
TestNumericUtils
TestNumericUtils.AnonymousClassIntRangeBuilder
TestNumericUtils.AnonymousClassLongRangeBuilder
TestNumericUtils.IntRangeBuilderAnonymousInnerClassHelper
TestNumericUtils.LongRangeBuilderAnonymousInnerClassHelper
TestOpenBitSet
TestPagedBytes
TestPriorityQueue
TestPriorityQueue.IntegerQueue
TestQueryBuilder
TestQueryBuilder.MockCJKSynonymAnalyzer
TestQueryBuilder.MockCJKSynonymFilter adds synonym of "國" for "国".
TestQueryBuilder.MockSynonymAnalyzer adds synonym of "dog" for "dogs".
TestQueryBuilder.MockSynonymFilter adds synonym of "dog" for "dogs".
TestQueryBuilder.SimpleCJKAnalyzer
TestQueryBuilder.SimpleCJKTokenizer
TestRamUsageEstimator
TestRamUsageEstimator.Holder
TestRamUsageEstimator.HolderSubclass
TestSetOnce
TestSetOnce.SetOnceThread
TestSortedVIntList
TestStringIntern
TestStringIntern.TestRun
TestTimSorter
TestVersion
TestVirtualMethod
TestVirtualMethod.BaseTestVirtualMethod LUCENENET specific class used here because inheriting test classes messes up the context that the tests are run in. So, we substitute a class that has no tests.
TestVirtualMethod.TestClass1
TestVirtualMethod.TestClass2
TestVirtualMethod.TestClass3
TestWeakIdentityMap
TestWeakIdentityMap.RunnableAnonymousInnerClassHelper
ThreadInterruptedException Thrown by lucene on detecting that Thread.interrupt() had been called. Unlike Java's InterruptedException, this exception is not checked..
ThrottledIndexOutput Intentionally slow IndexOutput for testing.
ToStringUtils Helper methods to ease implementing {@link Object#toString()}.
UnicodeUtil Class to encode java's UTF16 char[] into UTF8 byte[] without always allocating a new byte[] as String.getBytes("UTF-8") does.

WARNING: This API is a new and experimental and may suddenly change.

VersionEnumExtensionMethods
_TestUtil