C# Class Lucene.Net.Index.DirectoryReader

An IndexReader which reads indexes with multiple segments.
Inheritance: IndexReader
Datei anzeigen Open project: synhershko/lucene.net Class Usage Examples

Protected Properties

Property Type Description
internalDirectory Lucene.Net.Store.Directory
readOnly bool

Public Methods

Method Description
Clone ( bool openReadOnly ) : IndexReader
Clone ( ) : Object
Directory ( ) : Lucene.Net.Store.Directory

Returns the directory this index resides in.

DocFreq ( Lucene.Net.Index.Term t ) : int
Document ( int n, Lucene.Net.Documents.FieldSelector fieldSelector ) : Lucene.Net.Documents.Document
GetFieldNames ( IndexReader fieldNames ) : ICollection
GetSequentialSubReaders ( ) : Lucene.Net.Index.IndexReader[]
GetTermFreqVector ( int n, System field ) : ITermFreqVector
GetTermFreqVector ( int docNumber, System field, Lucene.Net.Index.TermVectorMapper mapper ) : void
GetTermFreqVector ( int docNumber, Lucene.Net.Index.TermVectorMapper mapper ) : void
GetTermFreqVectors ( int n ) : ITermFreqVector[]
HasNorms ( System field ) : bool
IsCurrent ( ) : bool
IsDeleted ( int n ) : bool
IsOptimized ( ) : bool

Checks is the index is optimized (if it has a single segment and no deletions)

ListCommits ( Lucene.Net.Store.Directory dir ) : ICollection
Norms ( System field ) : byte[]
Norms ( System field, byte result, int offset ) : void
NumDocs ( ) : int
Reopen ( ) : IndexReader
Reopen ( IndexCommit commit ) : IndexReader
Reopen ( bool openReadOnly ) : IndexReader
TermDocs ( ) : TermDocs
TermPositions ( ) : TermPositions
Terms ( ) : Lucene.Net.Index.TermEnum
Terms ( Lucene.Net.Index.Term term ) : Lucene.Net.Index.TermEnum

Protected Methods

Method Description
AcquireWriteLock ( ) : void

Tries to acquire the WriteLock on this directory. this method is only valid if this IndexReader is directory owner.

if another writer has this index open (write.lock could not be obtained)

DoClose ( ) : void
DoCommit ( string>.IDictionary commitUserData ) : void

Commit changes resulting from delete, undeleteAll, or setNorm operations

If an exception is hit, then either no changes or all changes will have been committed to the index (transactional semantics).

DoDelete ( int n ) : void
DoSetNorm ( int n, System field, byte value_Renamed ) : void
DoUndeleteAll ( ) : void

Private Methods

Method Description
DirectoryReader ( IndexWriter writer, SegmentInfos infos, int termInfosIndexDivisor ) : System
DirectoryReader ( Lucene.Net.Store.Directory directory, SegmentInfos sis, IndexDeletionPolicy deletionPolicy, bool readOnly, int termInfosIndexDivisor ) : System

Construct reading the named set of readers.

DirectoryReader ( Lucene.Net.Store.Directory directory, SegmentInfos infos, Lucene.Net.Index.SegmentReader oldReaders, int oldStarts, byte[]>.IEnumerable oldNormsCache, bool readOnly, bool doClone, int termInfosIndexDivisor ) : System

This constructor is only used for Reopen()

DoReopen ( SegmentInfos infos, bool doClone, bool openReadOnly ) : DirectoryReader
DoReopen ( bool openReadOnly, IndexCommit commit ) : IndexReader
DoReopenFromWriter ( bool openReadOnly, IndexCommit commit ) : IndexReader
DoReopenNoWriter ( bool openReadOnly, IndexCommit commit ) : IndexReader
GetFieldNames ( IndexReader fieldNames, IndexReader subReaders ) : ICollection
Initialize ( Lucene.Net.Index.SegmentReader subReaders ) : void
Open ( Lucene.Net.Store.Directory directory, IndexDeletionPolicy deletionPolicy, IndexCommit commit, bool readOnly, int termInfosIndexDivisor ) : IndexReader
ReaderIndex ( int n ) : int
ReaderIndex ( int n, int starts, int numSubReaders ) : int
RollbackCommit ( ) : void
StartCommit ( ) : void

Method Details

AcquireWriteLock() protected method

Tries to acquire the WriteLock on this directory. this method is only valid if this IndexReader is directory owner. if another writer has this index open (write.lock could not be obtained)
protected AcquireWriteLock ( ) : void
return void

Clone() public method

public Clone ( bool openReadOnly ) : IndexReader
openReadOnly bool
return IndexReader

Clone() public method

public Clone ( ) : Object
return Object

Directory() public method

Returns the directory this index resides in.
public Directory ( ) : Lucene.Net.Store.Directory
return Lucene.Net.Store.Directory

DoClose() protected method

protected DoClose ( ) : void
return void

DoCommit() protected method

Commit changes resulting from delete, undeleteAll, or setNorm operations

If an exception is hit, then either no changes or all changes will have been committed to the index (transactional semantics).

protected DoCommit ( string>.IDictionary commitUserData ) : void
commitUserData string>.IDictionary
return void

DoDelete() protected method

protected DoDelete ( int n ) : void
n int
return void

DoSetNorm() protected method

protected DoSetNorm ( int n, System field, byte value_Renamed ) : void
n int
field System
value_Renamed byte
return void

DoUndeleteAll() protected method

protected DoUndeleteAll ( ) : void
return void

DocFreq() public method

public DocFreq ( Lucene.Net.Index.Term t ) : int
t Lucene.Net.Index.Term
return int

Document() public method

public Document ( int n, Lucene.Net.Documents.FieldSelector fieldSelector ) : Lucene.Net.Documents.Document
n int
fieldSelector Lucene.Net.Documents.FieldSelector
return Lucene.Net.Documents.Document

GetFieldNames() public method

public GetFieldNames ( IndexReader fieldNames ) : ICollection
fieldNames IndexReader
return ICollection

GetSequentialSubReaders() public method

public GetSequentialSubReaders ( ) : Lucene.Net.Index.IndexReader[]
return Lucene.Net.Index.IndexReader[]

GetTermFreqVector() public method

public GetTermFreqVector ( int n, System field ) : ITermFreqVector
n int
field System
return ITermFreqVector

GetTermFreqVector() public method

public GetTermFreqVector ( int docNumber, System field, Lucene.Net.Index.TermVectorMapper mapper ) : void
docNumber int
field System
mapper Lucene.Net.Index.TermVectorMapper
return void

GetTermFreqVector() public method

public GetTermFreqVector ( int docNumber, Lucene.Net.Index.TermVectorMapper mapper ) : void
docNumber int
mapper Lucene.Net.Index.TermVectorMapper
return void

GetTermFreqVectors() public method

public GetTermFreqVectors ( int n ) : ITermFreqVector[]
n int
return ITermFreqVector[]

HasNorms() public method

public HasNorms ( System field ) : bool
field System
return bool

IsCurrent() public method

public IsCurrent ( ) : bool
return bool

IsDeleted() public method

public IsDeleted ( int n ) : bool
n int
return bool

IsOptimized() public method

Checks is the index is optimized (if it has a single segment and no deletions)
public IsOptimized ( ) : bool
return bool

ListCommits() public static method

public static ListCommits ( Lucene.Net.Store.Directory dir ) : ICollection
dir Lucene.Net.Store.Directory
return ICollection

Norms() public method

public Norms ( System field ) : byte[]
field System
return byte[]

Norms() public method

public Norms ( System field, byte result, int offset ) : void
field System
result byte
offset int
return void

NumDocs() public method

public NumDocs ( ) : int
return int

Reopen() public method

public Reopen ( ) : IndexReader
return IndexReader

Reopen() public method

public Reopen ( IndexCommit commit ) : IndexReader
commit IndexCommit
return IndexReader

Reopen() public method

public Reopen ( bool openReadOnly ) : IndexReader
openReadOnly bool
return IndexReader

TermDocs() public method

public TermDocs ( ) : TermDocs
return TermDocs

TermPositions() public method

public TermPositions ( ) : TermPositions
return TermPositions

Terms() public method

public Terms ( ) : Lucene.Net.Index.TermEnum
return Lucene.Net.Index.TermEnum

Terms() public method

public Terms ( Lucene.Net.Index.Term term ) : Lucene.Net.Index.TermEnum
term Lucene.Net.Index.Term
return Lucene.Net.Index.TermEnum

Property Details

internalDirectory protected_oe property

protected Lucene.Net.Store.Directory internalDirectory
return Lucene.Net.Store.Directory

readOnly protected_oe property

protected bool readOnly
return bool