You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/04/08 19:15:12 UTC

[GitHub] [lucene] romseygeek commented on a diff in pull request #803: LUCENE-10229: return -1 for unknown offsets in ExtendedIntervalsSource. Modify highlighting to work properly with or without offsets (depending on their availability).

romseygeek commented on code in PR #803:
URL: https://github.com/apache/lucene/pull/803#discussion_r846412825


##########
lucene/queries/src/java/org/apache/lucene/queries/intervals/ExtendedIntervalsSource.java:
##########
@@ -53,9 +55,60 @@ public IntervalMatchesIterator matches(String field, LeafReaderContext ctx, int
     if (in == null) {
       return null;
     }
+
+    IntervalMatchesIterator inNoOffsets =
+        new IntervalMatchesIterator() {
+          IntervalMatchesIterator delegate = in;
+
+          @Override
+          public int gaps() {
+            return delegate.gaps();
+          }
+
+          @Override
+          public int width() {
+            return delegate.width();
+          }
+
+          @Override
+          public boolean next() throws IOException {
+            return delegate.next();
+          }
+
+          @Override
+          public int startPosition() {
+            return delegate.startPosition();
+          }
+
+          @Override
+          public int endPosition() {
+            return delegate.endPosition();
+          }
+

Review Comment:
   I think we should always return -1 here? After all, we will always be extending things in at least one direction, so we will never be able to return correct offsets for the whole interval.



-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org