msokolov commented on a change in pull request #2256:
URL: https://github.com/apache/lucene-solr/pull/2256#discussion_r568110673
##########
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:
OK, maybe I misunderstood the intent. Perhaps an example would clarify.
Say that we have three segments, A, B , C containing documents `A={0, 3, 6};
B={1, 4, 7}; C={2, 5, 8}`, where the documents are understood to have a single
field with the value shown, and the index sort is ordered in the natural way.
Without this change, if we merged A and B, we'd get a new segment `A+B={0, 1,
3, 4, 6, 7}`. Now suppose there is no index sort (and the documents just
"happen" to be in the index in the order given above, for the sake of the
example), and we apply a `leafSorter` that sorts by the minimum value of any
document in the segment (I guess it could be any sort of aggregate over the
segment?), then we would get `A+B={0, 3, 6, 1, 4, 7}`. Now if we apply both
sorts, we would get the same result as in the first case, right? I'm still
unclear how the conflict arises.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]