mayya-sharipova commented on a change in pull request #2256: URL: https://github.com/apache/lucene-solr/pull/2256#discussion_r568095366
########## File path: lucene/core/src/java/org/apache/lucene/index/IndexWriter.java ########## @@ -933,6 +936,31 @@ protected final void ensureOpen() throws AlreadyClosedException { * low-level IO error */ public IndexWriter(Directory d, IndexWriterConfig conf) throws IOException { + this(d, conf, null); + } + + /** + * Constructs a new IndexWriter per the settings given in <code>conf</code>. If you want to make + * "live" changes to this writer instance, use {@link #getConfig()}. + * + * <p><b>NOTE:</b> after ths writer is created, the given configuration instance cannot be passed + * to another writer. + * + * @param d the index directory. The index is either created or appended according <code> + * conf.getOpenMode()</code>. + * @param conf the configuration settings according to which IndexWriter should be initialized. + * @param leafSorter 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 {@code + * 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 + * though segments and segments' documents. + * @throws IOException if the directory cannot be read/written to, or if it does not exist and + * <code>conf.getOpenMode()</code> is <code>OpenMode.APPEND</code> or if there is any other + * low-level IO error + */ + public IndexWriter(Directory d, IndexWriterConfig conf, Comparator<LeafReader> leafSorter) Review comment: Addressed in 7ddff67 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org