C# Class Lucene.Net.Index.ParallelReader

An IndexReader which reads multiple, parallel indexes. Each index added must have the same number of documents, but typically each contains different fields. Each document contains the union of the fields of all documents with the same document number. When searching, matches for a query term are from the first index added that has the field.

This is useful, e.g., with collections that have large fields which change rarely and small fields that change more frequently. The smaller fields may be re-indexed in a new index and both indexes may be searched together.

Warning: It is up to you to make sure all indexes are created and modified the same way. For example, if you add documents to one index, you need to add the same documents in the same order to the other indexes. Failure to do so will result in undefined behavior.

Inheritance: IndexReader
Mostra file Open project: synhershko/lucene.net Class Usage Examples

Public Methods

Method Description
Add ( IndexReader reader ) : void

Add an IndexReader.

Add ( IndexReader reader, bool ignoreStoredFields ) : void

Add an IndexReader whose stored fields will not be returned. This can accellerate search when stored fields are only needed from a subset of the IndexReaders.

of documents

of IndexReader.MaxDoc

Clone ( ) : Object
DocFreq ( Lucene.Net.Index.Term term ) : int
Document ( int n, Lucene.Net.Documents.FieldSelector fieldSelector ) : Lucene.Net.Documents.Document
GetFieldNames ( IndexReader fieldNames ) : System.Collections.Generic.ICollection
GetSubReaders ( ) : 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

Checks recursively if all subreaders are up to date.

IsDeleted ( int n ) : bool
IsOptimized ( ) : bool

Checks recursively if all subindexes are optimized

Norms ( System field ) : byte[]
Norms ( System field, byte result, int offset ) : void
NumDocs ( ) : int
ParallelReader ( ) : System

Construct a ParallelReader.

Note that all subreaders are closed if this ParallelReader is closed.

ParallelReader ( bool closeSubReaders ) : System

Construct a ParallelReader.

Reopen ( ) : IndexReader

Tries to reopen the subreaders.
If one or more subreaders could be re-opened (i. e. subReader.reopen() returned a new instance != subReader), then a new ParallelReader instance is returned, otherwise this instance is returned.

A re-opened instance might share one or more subreaders with the old instance. Index modification operations result in undefined behavior when performed before the old instance is closed. (see IndexReader.Reopen()).

If subreaders are shared, then the reference count of those readers is increased to ensure that the subreaders remain open until the last referring reader is closed.

TermDocs ( ) : TermDocs
TermDocs ( Lucene.Net.Index.Term term ) : TermDocs
TermPositions ( ) : TermPositions
TermPositions ( Lucene.Net.Index.Term term ) : TermPositions
Terms ( ) : Lucene.Net.Index.TermEnum
Terms ( Lucene.Net.Index.Term term ) : Lucene.Net.Index.TermEnum

Protected Methods

Method Description
DoClose ( ) : void
DoCommit ( string>.IDictionary commitUserData ) : void
DoDelete ( int n ) : void
DoReopen ( bool doClone ) : IndexReader
DoSetNorm ( int n, System field, byte value_Renamed ) : void
DoUndeleteAll ( ) : void

Method Details

Add() public method

Add an IndexReader.
public Add ( IndexReader reader ) : void
reader IndexReader
return void

Add() public method

Add an IndexReader whose stored fields will not be returned. This can accellerate search when stored fields are only needed from a subset of the IndexReaders. of documents of IndexReader.MaxDoc
public Add ( IndexReader reader, bool ignoreStoredFields ) : void
reader IndexReader
ignoreStoredFields bool
return void

Clone() public method

public Clone ( ) : Object
return System.Object

DoClose() protected method

protected DoClose ( ) : void
return void

DoCommit() protected method

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

DoDelete() protected method

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

DoReopen() protected method

protected DoReopen ( bool doClone ) : IndexReader
doClone bool
return IndexReader

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 term ) : int
term 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 ) : System.Collections.Generic.ICollection
fieldNames IndexReader
return System.Collections.Generic.ICollection

GetSubReaders() public method

public GetSubReaders ( ) : 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

Checks recursively if all subreaders are up to date.
public IsCurrent ( ) : bool
return bool

IsDeleted() public method

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

IsOptimized() public method

Checks recursively if all subindexes are optimized
public IsOptimized ( ) : bool
return bool

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

ParallelReader() public method

Construct a ParallelReader.

Note that all subreaders are closed if this ParallelReader is closed.

public ParallelReader ( ) : System
return System

ParallelReader() public method

Construct a ParallelReader.
public ParallelReader ( bool closeSubReaders ) : System
closeSubReaders bool indicates whether the subreaders should be closed /// when this ParallelReader is closed ///
return System

Reopen() public method

Tries to reopen the subreaders.
If one or more subreaders could be re-opened (i. e. subReader.reopen() returned a new instance != subReader), then a new ParallelReader instance is returned, otherwise this instance is returned.

A re-opened instance might share one or more subreaders with the old instance. Index modification operations result in undefined behavior when performed before the old instance is closed. (see IndexReader.Reopen()).

If subreaders are shared, then the reference count of those readers is increased to ensure that the subreaders remain open until the last referring reader is closed.

public Reopen ( ) : IndexReader
return IndexReader

TermDocs() public method

public TermDocs ( ) : TermDocs
return TermDocs

TermDocs() public method

public TermDocs ( Lucene.Net.Index.Term term ) : TermDocs
term Lucene.Net.Index.Term
return TermDocs

TermPositions() public method

public TermPositions ( ) : TermPositions
return TermPositions

TermPositions() public method

public TermPositions ( Lucene.Net.Index.Term term ) : TermPositions
term Lucene.Net.Index.Term
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