mirror of https://github.com/apache/lucene.git
LUCENE-10491: Fix correctness bug in TaxonomyFacetSumValueSource score providing (#775)
This commit is contained in:
parent
c4935d2fa3
commit
fb83387002
|
@ -93,6 +93,9 @@ Bug Fixes
|
||||||
* LUCENE-10477: Highlighter: WeightedSpanTermExtractor.extractWeightedSpanTerms to Query#rewrite
|
* LUCENE-10477: Highlighter: WeightedSpanTermExtractor.extractWeightedSpanTerms to Query#rewrite
|
||||||
multiple times if necessary. (Christine Poerschke, Adrien Grand)
|
multiple times if necessary. (Christine Poerschke, Adrien Grand)
|
||||||
|
|
||||||
|
* LUCENE-10491: A correctness bug in the way scores are provided within TaxonomyFacetSumValueSource
|
||||||
|
was fixed. (Michael McCandless, Greg Miller)
|
||||||
|
|
||||||
Build
|
Build
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class TaxonomyFacetSumValueSource extends FloatTaxonomyFacets {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean advanceExact(int doc) throws IOException {
|
public boolean advanceExact(int doc) throws IOException {
|
||||||
index++;
|
index = doc;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -353,8 +353,13 @@ public class TestTaxonomyFacetSumValueSource extends FacetTestCase {
|
||||||
IndexWriter iw = new IndexWriter(indexDir, newIndexWriterConfig(new MockAnalyzer(random())));
|
IndexWriter iw = new IndexWriter(indexDir, newIndexWriterConfig(new MockAnalyzer(random())));
|
||||||
|
|
||||||
FacetsConfig config = new FacetsConfig();
|
FacetsConfig config = new FacetsConfig();
|
||||||
|
|
||||||
|
// Add a doc without the price field to exercise the bug found in LUCENE-10491:
|
||||||
|
Document doc = new Document();
|
||||||
|
iw.addDocument(config.build(taxoWriter, doc));
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
Document doc = new Document();
|
doc = new Document();
|
||||||
doc.add(new NumericDocValuesField("price", (i + 1)));
|
doc.add(new NumericDocValuesField("price", (i + 1)));
|
||||||
doc.add(new FacetField("a", Integer.toString(i % 2)));
|
doc.add(new FacetField("a", Integer.toString(i % 2)));
|
||||||
iw.addDocument(config.build(taxoWriter, doc));
|
iw.addDocument(config.build(taxoWriter, doc));
|
||||||
|
|
Loading…
Reference in New Issue