mirror of https://github.com/apache/lucene.git
LUCENE-8519: MultiDocValues.getNormValues should not call getMergedFieldInfos (#902)
Co-authored-by: Rushabh Shah <shahrs87@apache.org>
This commit is contained in:
parent
59b6d41bd1
commit
d17c6056d8
|
@ -79,7 +79,7 @@ Improvements
|
|||
|
||||
Optimizations
|
||||
---------------------
|
||||
(No changes)
|
||||
* LUCENE-8519: MultiDocValues.getNormValues should not call getMergedFieldInfos (Rushabh Shah)
|
||||
|
||||
Bug Fixes
|
||||
---------------------
|
||||
|
|
|
@ -53,8 +53,18 @@ public class MultiDocValues {
|
|||
} else if (size == 1) {
|
||||
return leaves.get(0).reader().getNormValues(field);
|
||||
}
|
||||
FieldInfo fi = FieldInfos.getMergedFieldInfos(r).fieldInfo(field); // TODO avoid merging
|
||||
if (fi == null || fi.hasNorms() == false) {
|
||||
|
||||
// Check if any of the leaf reader which has this field has norms.
|
||||
boolean normFound = false;
|
||||
for (LeafReaderContext leaf : leaves) {
|
||||
LeafReader reader = leaf.reader();
|
||||
FieldInfo info = reader.getFieldInfos().fieldInfo(field);
|
||||
if (info != null && info.hasNorms()) {
|
||||
normFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (normFound == false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue