jpountz commented on a change in pull request #747: LUCENE-8888: Improve 
distribution of points with data dimension in BKD tree leaves
URL: https://github.com/apache/lucene-solr/pull/747#discussion_r298148526
 
 

 ##########
 File path: 
lucene/core/src/java/org/apache/lucene/util/bkd/BKDRadixSelector.java
 ##########
 @@ -60,14 +60,18 @@
   // prefix for temp files
   private final String tempFileNamePrefix;
 
+  private  int numDataDims, numIndexDims;
+
 
   /**
    * Sole constructor.
    */
-  public BKDRadixSelector(int numDim, int bytesPerDim, int 
maxPointsSortInHeap, Directory tempDir, String tempFileNamePrefix) {
+  public BKDRadixSelector(int numDataDims, int numIndexDims, int bytesPerDim, 
int maxPointsSortInHeap, Directory tempDir, String tempFileNamePrefix) {
     this.bytesPerDim = bytesPerDim;
-    this.packedBytesLength = numDim * bytesPerDim;
-    this.bytesSorted = bytesPerDim + Integer.BYTES;
+    this.numDataDims = numDataDims;
+    this.numIndexDims = numIndexDims;
+    this.packedBytesLength = numDataDims * bytesPerDim;
+    this.bytesSorted = bytesPerDim  + (numDataDims - numIndexDims) * 
bytesPerDim + Integer.BYTES;
 
 Review comment:
   Maybe add a comment saying that this accounts for the dimension we are 
sorting on, plus data-only dimensions and the doc ID. As we are making it more 
complex, it might be a bit tricky to understand what is happening here for 
someone who is reading this code for the first time.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to