Restore original "is within leaf" value in SparseVectorFieldMapper (#118380) (#118456)

This commit is contained in:
Mike Pellegrini 2024-12-11 09:23:44 -05:00 committed by GitHub
parent e355d989b6
commit dda00b7176
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,5 @@
pr: 118380
summary: Restore original "is within leaf" value in `SparseVectorFieldMapper`
area: Mapping
type: bug
issues: []

View File

@ -171,6 +171,7 @@ public class SparseVectorFieldMapper extends FieldMapper {
);
}
final boolean isWithinLeaf = context.path().isWithinLeafObject();
String feature = null;
try {
// make sure that we don't expand dots in field names while parsing
@ -205,7 +206,7 @@ public class SparseVectorFieldMapper extends FieldMapper {
context.addToFieldNames(fieldType().name());
}
} finally {
context.path().setWithinLeafObject(false);
context.path().setWithinLeafObject(isWithinLeaf);
}
}