rmuir commented on a change in pull request #286:
URL: https://github.com/apache/lucene/pull/286#discussion_r704816931



##########
File path: lucene/core/src/java/org/apache/lucene/search/SortField.java
##########
@@ -606,4 +609,26 @@ public IndexSorter getIndexSorter() {
         return null;
     }
   }
+
+  /**
+   * Disable numeric sort optimization to use the Points index to skip over 
non-competitive
+   * documents. By default sorting on a numeric field activates point sort 
optimization that can
+   * efficiently skip non-competitive hits. Sort optimization has a number of 
requirements, one of
+   * which is that SortField.Type matches the Point type with which the field 
was indexed (e.g. sort
+   * on IntPoint field should use SortField.Type.INT). Another requirement is 
that the same data is
+   * indexed with points and doc values for the field.
+   *
+   * <p>This allows to disable sort optimization, in cases where these 
requirements can't be met.
+   *
+   * @deprecated should only be used for compatibility with 8.x indices that 
got created with
+   *     inconsistent data across fields, or the wrong sort configuration in 
the index sort
+   */
+  @Deprecated // Remove in Lucene 9
+  public void disablePointSortOptimization() {
+    this.pointSortOptimizationDisabled = true;
+  }

Review comment:
       personally i think the default is handled by the boolean defaulting to 
`true` ? Just thinking that an ordinary getter/setter is the most obvious way 
to control it to have an intuitive API. It already looks much better




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

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

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

Reply via email to