You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/10/07 15:02:04 UTC

[lucene-solr] branch branch_8x updated: LUCENE-9569 Disalbe sort opt on _doc (#1959)

This is an automated email from the ASF dual-hosted git repository.

mayya pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 1c0f07a  LUCENE-9569 Disalbe sort opt on _doc (#1959)
1c0f07a is described below

commit 1c0f07ac03f0235adaf5c150f1c6656336e4282f
Author: Mayya Sharipova <ma...@elastic.co>
AuthorDate: Wed Oct 7 11:01:49 2020 -0400

    LUCENE-9569 Disalbe sort opt on _doc (#1959)
    
    Sort optimization on _doc was introduced in PR #1856,
    but it looks unstable and lead to some recent tests failure.
    As the release of 8.7 is very soon, we need to temporarily
    disable this sort optimization for _doc for this release
    with a plan to stabilize it for later releases.
---
 .../src/java/org/apache/lucene/search/comparators/DocComparator.java | 5 ++++-
 .../org/apache/lucene/search/TestFieldSortOptimizationSkipping.java  | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

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 c0b3e2e..b9de45f 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<Integer> {
     /** 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 96e6ad9..e8f2d85 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 class TestFieldSortOptimizationSkipping extends LuceneTestCase {
     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 class TestFieldSortOptimizationSkipping extends LuceneTestCase {
     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());