Method Open
Open(Directory)
Returns a IndexReader reading the index in the given Directory
Declaration
public static DirectoryReader Open(Directory directory)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | the index directory |
Returns
Type | Description |
---|---|
DirectoryReader |
Open(Directory, Int32)
Expert: Returns a IndexReader reading the index in the given Directory with the given termInfosIndexDivisor.
Declaration
public static DirectoryReader Open(Directory directory, int termInfosIndexDivisor)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | the index directory |
System.Int32 | termInfosIndexDivisor | Subsamples which indexed terms are loaded into RAM. this has the same effect as setting TermIndexInterval (on IndexWriterConfig) except that setting must be done at indexing time while this setting can be set per reader. When set to N, then one in every N*termIndexInterval terms in the index is loaded into memory. By setting this to a value > 1 you can reduce memory usage, at the expense of higher latency when loading a TermInfo. The default value is 1. Set this to -1 to skip loading the terms index entirely. NOTE: divisor settings > 1 do not apply to all PostingsFormat implementations, including the default one in this release. It only makes sense for terms indexes that can efficiently re-sample terms at load time. |
Returns
Type | Description |
---|---|
DirectoryReader |
Open(IndexWriter, Boolean)
Open a near real time IndexReader from the IndexWriter.
@lucene.experimental
Declaration
public static DirectoryReader Open(IndexWriter writer, bool applyAllDeletes)
Parameters
Type | Name | Description |
---|---|---|
IndexWriter | writer | The IndexWriter to open from |
System.Boolean | applyAllDeletes | If |
Returns
Type | Description |
---|---|
DirectoryReader | The new IndexReader |
Exceptions
Type | Condition |
---|---|
CorruptIndexException | if the index is corrupt |
See Also
Open(IndexCommit)
Expert: returns an IndexReader reading the index in the given IndexCommit.
Declaration
public static DirectoryReader Open(IndexCommit commit)
Parameters
Type | Name | Description |
---|---|---|
IndexCommit | commit | the commit point to open |
Returns
Type | Description |
---|---|
DirectoryReader |
Open(IndexCommit, Int32)
Expert: returns an IndexReader reading the index in the given
IndexCommit and termInfosIndexDivisor
.
Declaration
public static DirectoryReader Open(IndexCommit commit, int termInfosIndexDivisor)
Parameters
Type | Name | Description |
---|---|---|
IndexCommit | commit | the commit point to open |
System.Int32 | termInfosIndexDivisor | Subsamples which indexed terms are loaded into RAM. this has the same effect as setting TermIndexInterval (on IndexWriterConfig) except that setting must be done at indexing time while this setting can be set per reader. When set to N, then one in every N*termIndexInterval terms in the index is loaded into memory. By setting this to a value > 1 you can reduce memory usage, at the expense of higher latency when loading a TermInfo. The default value is 1. Set this to -1 to skip loading the terms index entirely. NOTE: divisor settings > 1 do not apply to all PostingsFormat implementations, including the default one in this release. It only makes sense for terms indexes that can efficiently re-sample terms at load time. |
Returns
Type | Description |
---|---|
DirectoryReader |