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
TermIndexInterval
(which can be set on IndexWriterConfig) except that setting
must be done at indexing time while this setting can be
set per reader. When set to |
Returns
Type | Description |
---|---|
DirectoryReader |
Open(IndexWriter, Boolean)
Open a near real time IndexReader from the IndexWriter.
Declaration
public static DirectoryReader Open(IndexWriter writer, bool applyAllDeletes)
Parameters
Type | Name | Description |
---|---|---|
IndexWriter | writer | The IndexWriter to open from |
System.Boolean | applyAllDeletes | If true, all buffered deletes will be applied (made visible) in the returned reader. If false, the deletes are not applied but remain buffered (in IndexWriter) so that they will be applied in the future. Applying deletes can be costly, so if your app can tolerate deleted documents being returned you might gain some performance by passing false. |
Returns
Type | Description |
---|---|
DirectoryReader | The new IndexReader |
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
TermIndexInterval
(which can be set in IndexWriterConfig) except that setting
must be done at indexing time while this setting can be
set per reader. When set to |
Returns
Type | Description |
---|---|
DirectoryReader |