diff --git a/src/main/java/org/apache/lucene/search/XTermsFilter.java b/src/main/java/org/apache/lucene/search/XTermsFilter.java index a2f2a8515fd..6873ebcd207 100644 --- a/src/main/java/org/apache/lucene/search/XTermsFilter.java +++ b/src/main/java/org/apache/lucene/search/XTermsFilter.java @@ -86,7 +86,10 @@ public class XTermsFilter extends Filter { length = index; } - + public Term[] getTerms() { + return filterTerms; + } + @Override public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { AtomicReader reader = context.reader(); diff --git a/src/main/java/org/apache/lucene/search/vectorhighlight/AbstractFragmentsBuilder.java b/src/main/java/org/apache/lucene/search/vectorhighlight/AbstractFragmentsBuilder.java index 2535655f9d8..d89a02f579a 100644 --- a/src/main/java/org/apache/lucene/search/vectorhighlight/AbstractFragmentsBuilder.java +++ b/src/main/java/org/apache/lucene/search/vectorhighlight/AbstractFragmentsBuilder.java @@ -144,7 +144,7 @@ public abstract class AbstractFragmentsBuilder extends BaseFragmentsBuilder { } } if (!toffsList.isEmpty()) { - subInfos.add(new FieldFragList.WeightedFragInfo.SubInfo(subInfo.text, toffsList, subInfo.getSeqnum())); + subInfos.add(new FieldFragList.WeightedFragInfo.SubInfo(subInfo.getText(), toffsList, subInfo.getSeqnum())); } if (subInfo.getTermsOffsets().isEmpty()) { @@ -175,9 +175,7 @@ public abstract class AbstractFragmentsBuilder extends BaseFragmentsBuilder { private final static List EMPTY = Collections.emptyList(); private WeightedFragInfo(int startOffset, int endOffset, float totalBoost, List subInfos) { - super(startOffset, endOffset, EMPTY); - this.subInfos = subInfos; - this.totalBoost = totalBoost; + super(startOffset, endOffset, subInfos, totalBoost); } } diff --git a/src/main/java/org/apache/lucene/search/vectorhighlight/XScoreOrderFragmentsBuilder.java b/src/main/java/org/apache/lucene/search/vectorhighlight/XScoreOrderFragmentsBuilder.java index 5e01d3112ca..9a3a33c472e 100644 --- a/src/main/java/org/apache/lucene/search/vectorhighlight/XScoreOrderFragmentsBuilder.java +++ b/src/main/java/org/apache/lucene/search/vectorhighlight/XScoreOrderFragmentsBuilder.java @@ -65,12 +65,12 @@ public class XScoreOrderFragmentsBuilder extends AbstractFragmentsBuilder { public static class ScoreComparator implements Comparator { public int compare(WeightedFragInfo o1, WeightedFragInfo o2) { - if (o1.totalBoost > o2.totalBoost) return -1; - else if (o1.totalBoost < o2.totalBoost) return 1; + if (o1.getTotalBoost() > o2.getTotalBoost()) return -1; + else if (o1.getTotalBoost() < o2.getTotalBoost()) return 1; // if same score then check startOffset else { - if (o1.startOffset < o2.startOffset) return -1; - else if (o1.startOffset > o2.startOffset) return 1; + if (o1.getStartOffset() < o2.getStartOffset()) return -1; + else if (o1.getStartOffset() > o2.getStartOffset()) return 1; } return 0; }