mirror of https://github.com/apache/lucene.git
LUCENE-9631: Properly override slice() on subclasses of OffsetRange.
This commit is contained in:
parent
4c100a0175
commit
a9e180b20a
|
@ -186,6 +186,8 @@ Bug fixes
|
|||
|
||||
Other
|
||||
|
||||
* LUCENE-9631: Properly override slice() on subclasses of OffsetRange. (Dawid Weiss)
|
||||
|
||||
* LUCENE-9312: Allow gradle builds against arbitrary JVMs. (Tomoko Uchida, Dawid Weiss)
|
||||
|
||||
* LUCENE-9391: Upgrade HPPC to 0.8.2. (Haoyu Zhai)
|
||||
|
|
|
@ -163,6 +163,11 @@ public class MatchHighlighter {
|
|||
super(from, to);
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryOffsetRange slice(int from, int to) {
|
||||
return new QueryOffsetRange(query, from, to);
|
||||
}
|
||||
}
|
||||
|
||||
private static class DocHit {
|
||||
|
|
|
@ -32,6 +32,15 @@ public class Passage extends OffsetRange {
|
|||
this.markers = markers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Passages can't be sliced as it could split previously determined
|
||||
* highlight markers.
|
||||
*/
|
||||
@Override
|
||||
public OffsetRange slice(int from, int to) {
|
||||
throw new RuntimeException("Passages.slice() does not make sense?");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[" + super.toString() + ", markers=" + markers + "]";
|
||||
|
|
Loading…
Reference in New Issue