mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 18:35:25 +00:00
lucene4: org.apache.lucene.search.vectorhighlight package cleanup
This commit is contained in:
parent
639b1323b8
commit
e8092fe290
@ -86,7 +86,10 @@ public class XTermsFilter extends Filter {
|
|||||||
length = index;
|
length = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Term[] getTerms() {
|
||||||
|
return filterTerms;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
|
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
|
||||||
AtomicReader reader = context.reader();
|
AtomicReader reader = context.reader();
|
||||||
|
@ -144,7 +144,7 @@ public abstract class AbstractFragmentsBuilder extends BaseFragmentsBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!toffsList.isEmpty()) {
|
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()) {
|
if (subInfo.getTermsOffsets().isEmpty()) {
|
||||||
@ -175,9 +175,7 @@ public abstract class AbstractFragmentsBuilder extends BaseFragmentsBuilder {
|
|||||||
private final static List<FieldPhraseList.WeightedPhraseInfo> EMPTY = Collections.emptyList();
|
private final static List<FieldPhraseList.WeightedPhraseInfo> EMPTY = Collections.emptyList();
|
||||||
|
|
||||||
private WeightedFragInfo(int startOffset, int endOffset, float totalBoost, List<FieldFragList.WeightedFragInfo.SubInfo> subInfos) {
|
private WeightedFragInfo(int startOffset, int endOffset, float totalBoost, List<FieldFragList.WeightedFragInfo.SubInfo> subInfos) {
|
||||||
super(startOffset, endOffset, EMPTY);
|
super(startOffset, endOffset, subInfos, totalBoost);
|
||||||
this.subInfos = subInfos;
|
|
||||||
this.totalBoost = totalBoost;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,12 +65,12 @@ public class XScoreOrderFragmentsBuilder extends AbstractFragmentsBuilder {
|
|||||||
public static class ScoreComparator implements Comparator<WeightedFragInfo> {
|
public static class ScoreComparator implements Comparator<WeightedFragInfo> {
|
||||||
|
|
||||||
public int compare(WeightedFragInfo o1, WeightedFragInfo o2) {
|
public int compare(WeightedFragInfo o1, WeightedFragInfo o2) {
|
||||||
if (o1.totalBoost > o2.totalBoost) return -1;
|
if (o1.getTotalBoost() > o2.getTotalBoost()) return -1;
|
||||||
else if (o1.totalBoost < o2.totalBoost) return 1;
|
else if (o1.getTotalBoost() < o2.getTotalBoost()) return 1;
|
||||||
// if same score then check startOffset
|
// if same score then check startOffset
|
||||||
else {
|
else {
|
||||||
if (o1.startOffset < o2.startOffset) return -1;
|
if (o1.getStartOffset() < o2.getStartOffset()) return -1;
|
||||||
else if (o1.startOffset > o2.startOffset) return 1;
|
else if (o1.getStartOffset() > o2.getStartOffset()) return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user