Package org.apache.lucene.index
Code to maintain and access indices.
-
Interface Summary Interface Description IndexDeletionPolicy Expert: policy for deletion of staleindex commits
.IndexReader.ReaderClosedListener A custom listener that's invoked when the IndexReader is closed.SegmentReader.CoreClosedListener Called when the shared core for this SegmentReader is closed.TermDocs TermDocs provides an interface for enumerating <document, frequency> pairs for a term.TermFreqVector Provides access to stored term vector of a document field.TermPositions TermPositions provides an interface for enumerating the <document, frequency, <position>* > tuples for a term.TermPositionVector ExtendsTermFreqVector
to provide additional information about positions in which each of the terms is found. -
Class Summary Class Description AbstractAllTermDocs Base class for enumerating all but deleted docs.CheckIndex Basic tool and API to check the health of an index and write a new segments file that removes reference to problematic segments.CheckIndex.Status Returned fromCheckIndex.checkIndex()
detailing the health and status of the index.CheckIndex.Status.FieldNormStatus Status from testing field norms.CheckIndex.Status.SegmentInfoStatus Holds the status of each segment in the index.CheckIndex.Status.StoredFieldStatus Status from testing stored fields.CheckIndex.Status.TermIndexStatus Status from testing term index.CheckIndex.Status.TermVectorStatus Status from testing stored fields.CompoundFileWriter Combines multiple files into a single compound file.ConcurrentMergeScheduler AMergeScheduler
that runs each merge using a separate thread.FieldInfo Access to the Fieldable Info file that describes document fields and whether or not they are indexed.FieldInfos Collection ofFieldInfo
s (accessible by number or by name).FieldInvertState This class tracks the number and position / offset parameters of terms being added to the index.FieldSortedTermVectorMapper For each Field, store a sorted collection ofTermVectorEntry
sFilterIndexReader AFilterIndexReader
contains another IndexReader, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.FilterIndexReader.FilterTermDocs Base class for filteringTermDocs
implementations.FilterIndexReader.FilterTermEnum Base class for filteringTermEnum
implementations.FilterIndexReader.FilterTermPositions Base class for filteringTermPositions
implementations.IndexCommit Expert: represents a single commit into an index as seen by theIndexDeletionPolicy
orIndexReader
.IndexFileNameFilter Filename filter that accept filenames and extensions only created by Lucene.IndexFileNames This class contains useful constants representing filenames and extensions used by lucene, as well as convenience methods for querying whether a file name matches an extension (matchesExtension
), as well as generating file names from a segment name, generation and extension (fileNameFromGeneration
,segmentFileName
).IndexReader IndexReader is an abstract class, providing an interface for accessing an index.IndexUpgrader This is an easy-to-use tool that upgrades all segments of an index from previous Lucene versions to the current segment file format.IndexWriter AnIndexWriter
creates and maintains an index.IndexWriter.IndexReaderWarmer IfIndexWriter.getReader()
has been called (ie, this writer is in near real-time mode), then after a merge completes, this class can be invoked to warm the reader on the newly merged segment, before the merge commits.IndexWriter.MaxFieldLength Deprecated. useLimitTokenCountAnalyzer
instead.IndexWriterConfig Holds all the configuration ofIndexWriter
.KeepOnlyLastCommitDeletionPolicy ThisIndexDeletionPolicy
implementation that keeps only the most recent commit and immediately removes all prior commits after a new commit is done.LogByteSizeMergePolicy This is aLogMergePolicy
that measures size of a segment as the total byte size of the segment's files.LogDocMergePolicy This is aLogMergePolicy
that measures size of a segment as the number of documents (not taking deletions into account).LogMergePolicy This class implements aMergePolicy
that tries to merge segments into levels of exponentially increasing size, where each level has fewer segments than the value of the merge factor.MergePolicy Expert: a MergePolicy determines the sequence of primitive merge operations.MergePolicy.MergeSpecification A MergeSpecification instance provides the information necessary to perform multiple merges.MergePolicy.OneMerge OneMerge provides the information necessary to perform an individual primitive merge operation, resulting in a single new segment.MergeScheduler Expert:IndexWriter
uses an instance implementing this interface to execute the merges selected by aMergePolicy
.MultipleTermPositions MultiReader An IndexReader which reads multiple indexes, appending their content.NoDeletionPolicy AnIndexDeletionPolicy
which keeps all index commits around, never deleting them.NoMergePolicy AMergePolicy
which never returns merges to execute (hence it's name).NoMergeScheduler AMergeScheduler
which never executes any merges.ParallelReader An IndexReader which reads multiple, parallel indexes.Payload A Payload is metadata that can be stored together with each occurrence of a term.PayloadProcessorProvider Provides aPayloadProcessorProvider.ReaderPayloadProcessor
to be used for aDirectory
.PayloadProcessorProvider.DirPayloadProcessor Deprecated. UsePayloadProcessorProvider.ReaderPayloadProcessor
instead.PayloadProcessorProvider.PayloadProcessor Processes the given payload.PayloadProcessorProvider.ReaderPayloadProcessor Returns aPayloadProcessorProvider.PayloadProcessor
for a givenTerm
which allows processing the payloads of different terms differently.PersistentSnapshotDeletionPolicy ASnapshotDeletionPolicy
which adds a persistence layer so that snapshots can be maintained across the life of an application.PositionBasedTermVectorMapper For each Field, store position by position information.PositionBasedTermVectorMapper.TVPositionInfo Container for a term at a positionSegmentInfo Information about a segment such as it's name, directory, and files related to the segment.SegmentInfos A collection of segmentInfo objects with methods for operating on those segments in relation to the file system.SegmentInfos.FindSegmentsFile Utility class for executing code that needs to do something with the current segments file.SegmentReader IndexReader implementation over a single segment.SegmentWriteState Holder class for common parameters used during write.SerialMergeScheduler AMergeScheduler
that simply does each merge sequentially, using the current thread.SnapshotDeletionPolicy AnIndexDeletionPolicy
that wraps around any otherIndexDeletionPolicy
and adds the ability to hold and later release snapshots of an index.SortedTermVectorMapper Store a sorted collection ofTermVectorEntry
s.Term A Term represents a word from text.TermEnum Abstract class for enumerating terms.TermVectorEntry Convenience class for holding TermVector information.TermVectorEntryFreqSortedComparator ComparesTermVectorEntry
s first by frequency and then by the term (case-sensitive)TermVectorMapper The TermVectorMapper can be used to map Term Vectors into your own structure instead of the parallel array structure used byIndexReader.getTermFreqVector(int,String)
.TermVectorOffsetInfo The TermVectorOffsetInfo class holds information pertaining to a Term in aTermPositionVector
's offset information.TieredMergePolicy Merges segments of approximately equal size, subject to an allowed number of segments per tier.TieredMergePolicy.MergeScore Holds score and explanation for a single candidate merge.UpgradeIndexMergePolicy ThisMergePolicy
is used for upgrading all existing segments of an index when callingIndexWriter.forceMerge(int)
. -
Enum Summary Enum Description FieldInfo.IndexOptions Controls how much information is stored in the postings lists.IndexWriterConfig.OpenMode Specifies the open mode forIndexWriter
:IndexWriterConfig.OpenMode.CREATE
- creates a new index or overwrites an existing one. -
Exception Summary Exception Description CorruptIndexException This exception is thrown when Lucene detects an inconsistency in the index.FieldReaderException Exception thrown when stored fields have an unexpected format.IndexFormatTooNewException This exception is thrown when Lucene detects an index that is newer than this Lucene version.IndexFormatTooOldException This exception is thrown when Lucene detects an index that is too old for this Lucene versionIndexNotFoundException Signals that no index was found in the Directory.MergePolicy.MergeAbortedException MergePolicy.MergeException Exception thrown if there are any problems while executing a merge.StaleReaderException This exception is thrown when anIndexReader
tries to make changes to the index (viaIndexReader.deleteDocument(int)
,IndexReader.undeleteAll()
orIndexReader.setNorm(int, java.lang.String, byte)
) but changes have already been committed to the index since this reader was instantiated.