Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
List of all members
Lucene.Net.Index.ReadOnlyDirectoryReader Class Reference

Inherits Lucene.Net.Index.DirectoryReader.

Additional Inherited Members

- Public Member Functions inherited from Lucene.Net.Index.DirectoryReader
override Object Clone ()
 Efficiently clones the IndexReader (sharing most internal state). On cloning a reader with pending changes (deletions, norms), the original reader transfers its write lock to the cloned reader. This means only the cloned reader may make further changes to the index, and commit the changes to the index on close, but the old reader still reflects all changes made up until it was cloned. Like Reopen(), it's safe to make changes to either the original or the cloned reader: all shared mutable state obeys "copy on write" semantics to ensure the changes are not seen by other readers.
 
override IndexReader Clone (bool openReadOnly)
 Clones the IndexReader and optionally changes readOnly. A readOnly reader cannot open a writeable reader.
 
override IndexReader Reopen ()
 Refreshes an IndexReader if the index has changed since this instance was (re)opened. Opening an IndexReader is an expensive operation. This method can be used to refresh an existing IndexReader to reduce these costs. This method tries to only load segments that have changed or were created after the IndexReader was (re)opened. If the index has not changed since this instance was (re)opened, then this call is a NOOP and returns this instance. Otherwise, a new instance is returned. The old instance is not closed and remains usable.
If the reader is reopened, even though they share resources internally, it's safe to make changes (deletions, norms) with the new reader. All shared mutable state obeys "copy on write" semantics to ensure the changes are not seen by other readers. You can determine whether a reader was actually reopened by comparing the old instance with the instance returned by this method:
 
override IndexReader Reopen (bool openReadOnly)
 Just like Reopen(), except you can change the readOnly of the original reader. If the index is unchanged but readOnly is different then a new reader will be returned.
 
override IndexReader Reopen (IndexCommit commit)
 Expert: reopen this reader on a specific commit point. This always returns a readOnly reader. If the specified commit point matches what this reader is already on, and this reader is already readOnly, then this same instance is returned; if it is not already readOnly, a readOnly clone is returned.
 
override ITermFreqVector[] GetTermFreqVectors (int n)
 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 may either be of type ITermFreqVector or of type TermPositionVector if positions or offsets have been stored.
 
override ITermFreqVector GetTermFreqVector (int n, System.String field)
 
override void GetTermFreqVector (int docNumber, System.String field, TermVectorMapper mapper)
 
override void GetTermFreqVector (int docNumber, TermVectorMapper mapper)
 Map all the term vectors for all fields in a Document
 
override bool IsOptimized ()
 Checks is the index is optimized (if it has a single segment and no deletions)
 
override int NumDocs ()
 Returns the number of documents in this index.
 
override Document Document (int n, FieldSelector fieldSelector)
 Get the Lucene.Net.Documents.Document at the n th position. The FieldSelector may be used to determine what Lucene.Net.Documents.Fields to load and how they should be loaded. NOTE: If this Reader (more specifically, the underlying FieldsReader) is closed before the lazy Lucene.Net.Documents.Field is loaded an exception may be thrown. If you want the value of a lazy Lucene.Net.Documents.Field to be available after closing you must explicitly load it or fetch the Document again with a new loader. NOTE: for performance reasons, this method does not check if the requested document is deleted, and therefore asking for a deleted document may yield unspecified results. Usually this is not required, however you can call IsDeleted(int) with the requested document ID to verify the document is not deleted.
 
override bool IsDeleted (int n)
 Returns true if document n has been deleted
 
override bool HasNorms (System.String field)
 Returns true if there are norms stored for this field.
 
override byte[] Norms (System.String field)
 Returns the byte-encoded normalization factor for the named field of every document. This is used by the search code to score documents.
 
override void Norms (System.String field, byte[] result, int offset)
 Reads the byte-encoded normalization factor for the named field of every document. This is used by the search code to score documents.
 
override TermEnum Terms ()
 Returns an enumeration of all the terms in the index. The enumeration is ordered by Term.compareTo(). Each term is greater than all that precede it in the enumeration. Note that after calling terms(), TermEnum.Next() must be called on the resulting enumeration before calling other methods such as TermEnum.Term.
 
override TermEnum Terms (Term term)
 Returns an enumeration of all terms starting at a given term. If the given term does not exist, the enumeration is positioned at the first term greater than the supplied term. The enumeration is ordered by Term.compareTo(). Each term is greater than all that precede it in the enumeration.
 
override int DocFreq (Term t)
 Returns the number of documents containing the term t.
 
override TermDocs TermDocs ()
 Returns an unpositioned Lucene.Net.Index.TermDocs enumerator.
 
override TermPositions TermPositions ()
 Returns an unpositioned Lucene.Net.Index.TermPositions enumerator.
 
override bool IsCurrent ()
 Check whether any new changes have occurred to the index since this reader was opened.
 
override ICollection< string > GetFieldNames (IndexReader.FieldOption fieldNames)
 
override IndexReader[] GetSequentialSubReaders ()
 Expert: returns the sequential sub readers that this reader is logically composed of. For example, IndexSearcher uses this API to drive searching by one sub reader at a time. If this reader is not composed of sequential child readers, it should return null. If this method returns an empty array, that means this reader is a null reader (for example a MultiReader that has no sub readers). NOTE: You should not try using sub-readers returned by this method to make any changes (setNorm, deleteDocument, etc.). While this might succeed for one composite reader (like MultiReader), it will most likely lead to index corruption for other readers (like DirectoryReader obtained through IndexReader.Open(Lucene.Net.Store.Directory,bool). Use the parent reader directly.
 
override Directory Directory ()
 Returns the directory this index resides in.
 
- Static Public Member Functions inherited from Lucene.Net.Index.DirectoryReader
static new ICollection
< IndexCommit
ListCommits (Directory dir)
 
- Protected Member Functions inherited from Lucene.Net.Index.IndexReader
virtual void Dispose (bool disposing)
 
- Properties inherited from Lucene.Net.Index.DirectoryReader
override long Version [get]
 Version number when this IndexReader was opened.
 
override int MaxDoc [get]
 
override bool HasDeletions [get]
 
override IDictionary< string,
string > 
CommitUserData [get]
 
override int TermInfosIndexDivisor [get]
 
override IndexCommit IndexCommit [get]
 Expert: return the IndexCommit that this reader has opened. WARNING: this API is new and experimental and may suddenly change.
 

Detailed Description

Definition at line 25 of file ReadOnlyDirectoryReader.cs.


The documentation for this class was generated from the following file: