You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/01 17:11:37 UTC

[GitHub] [lucene-solr] mayya-sharipova commented on a change in pull request #2256: LUCENE-9507 Custom order for leaves in IndexReader and IndexWriter

mayya-sharipova commented on a change in pull request #2256:
URL: https://github.com/apache/lucene-solr/pull/2256#discussion_r567994353



##########
File path: lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
##########
@@ -941,6 +969,11 @@ public IndexWriter(Directory d, IndexWriterConfig conf) throws IOException {
     // obtain the write.lock. If the user configured a timeout,
     // we wrap with a sleeper and this might take some time.
     writeLock = d.obtainLock(WRITE_LOCK_NAME);
+    if (config.getIndexSort() != null && leafSorter != null) {
+      throw new IllegalArgumentException(
+          "[IndexWriter] can't use index sort and leaf sorter at the same time!");

Review comment:
       @mikemccand Thank you for your review! From the discussion on the Jira ticket, we also wanted to use writer's `leafSorter` during merging for arranging docs in  a merged segment (by putting first docs from a segment with highest sort values according to `leafSorter`).
   
   This will be in conflict with `indexSorter`, as if provided [it will arrange merged docs according to its sort](https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/index/MergeState.java#L211).




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org