vsop-479 commented on code in PR #13192:
URL: https://github.com/apache/lucene/pull/13192#discussion_r1543074950


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnumFrame.java:
##########
@@ -554,49 +683,128 @@ public SeekStatus scanToTermLeaf(BytesRef target, 
boolean exactOnly) throws IOEx
 
     assert prefixMatches(target);
 
-    // TODO: binary search when all terms have the same length, which is 
common for ID fields,
-    // which are also the most sensitive to lookup performance?
-    // Loop over each entry (term or sub-block) in this block:
-    do {
-      nextEnt++;
+    // TODO early terminate when target length unequals suffix + prefix.
+    // But we need to keep the same status with scanToTermLeaf.
+    int start = nextEnt;
+    int end = entCount - 1;
+    // Binary search the entries (terms) in this leaf block:
+    int cmp = 0;
+    while (start <= end) {
+      int mid = (start + end) / 2;

Review Comment:
   Yes, i will merge https://github.com/apache/lucene/pull/11888 into this 
change.



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