open
Returns a IndexReader reading the index in the given Directory
Parameters
the index directory
Throws
if there is a low-level IO error
Returns a IndexReader for the index in the given Directory
Parameters
the index directory
a comparator for sorting leaf readers. Providing leafSorter is useful for indices on which it is expected to run many queries with particular sort criteria (e.g. for time-based indices this is usually a descending sort on timestamp). In this case leafSorter should sort leaves according to this sort criteria. Providing leafSorter allows to speed up this particular type of sort queries by early terminating while iterating through segments and segments' documents.
Throws
if there is a low-level IO error
Open a near real time IndexReader from the IndexWriter.
Return
The new IndexReader
Parameters
The IndexWriter to open from
See also
.openIfChanged
Throws
if the index is corrupt
if there is a low-level IO error
Expert: returns an IndexReader reading the index in the given IndexCommit.
Parameters
the commit point to open
Throws
if there is a low-level IO error
Expert: returns an IndexReader reading the index on the given IndexCommit. This method allows to open indices that were created with a Lucene version older than N-1 provided that all codecs for this index are available in the classpath and the segment file format used was created with Lucene 7 or newer. Users of this API must be aware that Lucene doesn't guarantee semantic compatibility for indices created with versions older than N-1. All backwards compatibility aside from the file format is optional and applied on a best effort basis.
Parameters
the commit point to open
the minimum supported major index version
a comparator for sorting leaf readers. Providing leafSorter is useful for indices on which it is expected to run many queries with particular sort criteria (e.g. for time-based indices, this is usually a descending sort on timestamp). In this case leafSorter should sort leaves according to this sort criteria. Providing leafSorter allows to speed up this particular type of sort queries by early terminating while iterating through segments and segments' documents
Throws
if there is a low-level IO error