diff --git a/lucene/core/src/java/org/apache/lucene/search/comparators/DocComparator.java b/lucene/core/src/java/org/apache/lucene/search/comparators/DocComparator.java index c0b3e2efdbdf..b9de45f3d983 100644 --- a/lucene/core/src/java/org/apache/lucene/search/comparators/DocComparator.java +++ b/lucene/core/src/java/org/apache/lucene/search/comparators/DocComparator.java @@ -40,8 +40,11 @@ public class DocComparator extends FieldComparator { /** Creates a new comparator based on document ids for {@code numHits} */ public DocComparator(int numHits, boolean reverse, int sortPost) { this.docIDs = new int[numHits]; + // Temporarily disable sort optimization for 8.7 release + this.enableSkipping = false; + // TODO: enable sort optimization after 8.7 release // skipping functionality is enabled if we are sorting by _doc in asc order as a primary sort - this.enableSkipping = (reverse == false && sortPost == 0); + // this.enableSkipping = (reverse == false && sortPost == 0); } @Override diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFieldSortOptimizationSkipping.java b/lucene/core/src/test/org/apache/lucene/search/TestFieldSortOptimizationSkipping.java index 96e6ad941ebc..e8f2d8547d0b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestFieldSortOptimizationSkipping.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestFieldSortOptimizationSkipping.java @@ -321,6 +321,7 @@ public void testFloatSortOptimization() throws IOException { dir.close(); } + @AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-9569") public void testDocSortOptimizationWithAfter() throws IOException { final Directory dir = newDirectory(); final IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig()); @@ -397,7 +398,7 @@ public void testDocSortOptimizationWithAfter() throws IOException { dir.close(); } - + @AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-9569") public void testDocSortOptimization() throws IOException { final Directory dir = newDirectory(); final IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig());