mirror of https://github.com/apache/lucene.git
LUCENE-8121: Fix span terms frequency to return the freq of the entire spans (not the frequency of the term within the span).
This commit is contained in:
parent
75d50b4492
commit
fd7aea5bed
|
@ -400,7 +400,7 @@ public class PhraseHelper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int freq() throws IOException {
|
public int freq() throws IOException {
|
||||||
return startOffsets.length;
|
return numPairs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class TestUnifiedHighlighterStrictPhrases extends LuceneTestCase {
|
||||||
return Arrays.toString(passages);
|
return Arrays.toString(passages);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
assertArrayEquals(new String[]{"[Passage[0-22]{yin[0-3],yang[4-8],yin[10-13]}score=2.0685003]"},
|
assertArrayEquals(new String[]{"[Passage[0-22]{yin[0-3],yang[4-8],yin[10-13]}score=2.4964213]"},
|
||||||
highlighter.highlight("body", query, topDocs));
|
highlighter.highlight("body", query, topDocs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ public class TestUnifiedHighlighterStrictPhrases extends LuceneTestCase {
|
||||||
return Arrays.toString(passages);
|
return Arrays.toString(passages);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
assertArrayEquals(new String[]{"[Passage[0-41]{alpha[0-5],bravo[6-11],charlie[12-19]}score=2.723861]"},
|
assertArrayEquals(new String[]{"[Passage[0-41]{alpha[0-5],bravo[6-11],charlie[12-19]}score=3.931102]"},
|
||||||
highlighter.highlight("body", query, topDocs));
|
highlighter.highlight("body", query, topDocs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue