Lucene.Net 1.9.1 Class Library

IndexReader Members

IndexReader overview

Public Static Methods

GetCurrentVersionOverloaded. Reads version number from segments files. The version number is initialized with a timestamp and then increased by one for each change of the index.
IndexExistsOverloaded. Returns
true
if an index exists at the specified directory. If the directory does not exist or if there is no index in it.
false
is returned.
IsLockedOverloaded. Returns
true
iff the index in the named directory is currently locked.
LastModifiedOverloaded. Returns the time the index in the named directory was last modified. Do not use this to check whether the reader is still up-to-date, use {@link #IsCurrent()} instead.
Main Prints the filename and size of each file within a given compound file. Add the -extract flag to extract files to the current working directory. In order to make the extracted version of the index work, you have to copy the segments file from the compound index into the directory where the extracted files are stored.
OpenOverloaded. Returns an IndexReader reading the index in an FSDirectory in the named path.
Unlock 

Public Instance Methods

Close Closes files associated with this index. Also saves any new deletions to disk. No other methods should be called after this has been called.
DeleteOverloaded. Deletes the document numbered
docNum
. Once a document is deleted it will not appear in TermDocs or TermPostitions enumerations. Attempts to read its field with the {@link #document} method will result in an error. The presence of this document may still be reflected in the {@link #docFreq} statistic, though this will be corrected eventually as the index is further modified.
DeleteDocumentDeletes the document numbered
docNum
. Once a document is deleted it will not appear in TermDocs or TermPostitions enumerations. Attempts to read its field with the {@link #document} method will result in an error. The presence of this document may still be reflected in the {@link #docFreq} statistic, though this will be corrected eventually as the index is further modified.
DeleteDocumentsDeletes all documents containing
term
. This is useful if one uses a document field to hold a unique ID string for the document. Then to delete such a document, one merely constructs a term with the appropriate field and the unique ID string as its text and passes it to this method. See {@link #Delete(int)} for information about when this deletion will become effective.
DirectoryReturns the directory this index resides in.
DocFreqReturns the number of documents containing the term
t
.
DocumentReturns the stored fields of the
n
th
Document
in this index.
Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
GetFieldNamesOverloaded. Get a list of unique field names that exist in this index and have the specified field option information.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetIndexedFieldNamesOverloaded. Get a list of unique field names that exist in this index, are indexed, and have the specified term vector information.
GetTermFreqVector Return a term frequency vector for the specified document and field. The returned vector contains terms and frequencies for the terms in the specified field of this document, if the field had the storeTermVector flag set. If termvectors had been stored with positions or offsets, a TermPositionsVector is returned.
GetTermFreqVectors Return an array of term frequency vectors for the specified document. The array contains a vector for each vectorized field in the document. Each vector contains terms and frequencies for all terms in a given vectorized field. If no such fields existed, the method returns null. The term vectors that are returned my either be of type TermFreqVector or of type TermPositionsVector if positions or offsets have been stored.
GetType (inherited from Object) Gets the Type of the current instance.
GetVersion Version number when this IndexReader was opened.
HasDeletionsReturns true if any documents have been deleted
HasNormsReturns true if there are norms stored for this field.
IsCurrent Check whether this IndexReader still works on a current version of the index. If this is not the case you will need to re-open the IndexReader to make sure you see the latest changes made to the index.
IsDeletedReturns true if document n has been deleted
MaxDocReturns one greater than the largest possible document number. This may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.
NormsOverloaded. Reads the byte-encoded normalization factor for the named field of every document. This is used by the search code to score documents.
NumDocsReturns the number of documents in this index.
SetNormOverloaded. Expert: Resets the normalization factor for the named field of the named document.
TermDocsOverloaded. Returns an unpositioned {@link TermDocs} enumerator.
TermPositionsOverloaded. Returns an unpositioned {@link TermPositions} enumerator.
TermsOverloaded. Returns an enumeration of all terms after a given term. The enumeration is ordered by Term.compareTo(). Each term is greater than all that precede it in the enumeration.
ToString (inherited from Object) Returns a String that represents the current Object.
UndeleteAllUndeletes all documents currently marked as deleted in this index.

Protected Instance Methods

FinalizeRelease the write lock, if needed.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

Protected Internal Instance Constructors

IndexReader Constructor Constructor used if IndexReader is not owner of its directory. This is used for IndexReaders that are used within other IndexReaders that take care or locking directories.

Protected Internal Instance Methods

Commit Commit changes resulting from delete, undeleteAll, or setNorm operations
DoCloseImplements close.
DoCommitImplements commit.
DoDeleteImplements deletion of the document numbered
docNum
. Applications should call {@link #Delete(int)} or {@link #Delete(Term)}.
DoSetNormImplements setNorm in subclass.
DoUndeleteAllImplements actual undeleteAll() in subclass.

See Also

IndexReader Class | Lucene.Net.Index Namespace