@@ -57,14 +57,27 @@ protected FallbackSyntheticSourceBlockLoader(
5757 this .fieldPaths = splitIntoFieldPaths (fieldName );
5858 }
5959
60+ /**
61+ * Returns the ignored source format used by this loader.
62+ */
63+ public IgnoredSourceFieldMapper .IgnoredSourceFormat ignoredSourceFormat () {
64+ return ignoredSourceFormat ;
65+ }
66+
6067 @ Override
6168 public IOFunction <CircuitBreaker , ColumnAtATimeReader > columnAtATimeReader (LeafReaderContext context ) {
6269 return null ;
6370 }
6471
6572 @ Override
6673 public RowStrideReader rowStrideReader (CircuitBreaker breaker , LeafReaderContext context ) throws IOException {
67- return new IgnoredSourceRowStrideReader <>(breaker , fieldName , fieldPaths , reader , ignoredSourceFormat );
74+ return new IgnoredSourceRowStrideReader <>(
75+ breaker ,
76+ fieldName ,
77+ fieldPaths ,
78+ reader ,
79+ ignoredSourceFormat .createLeafLoader (context .reader ())
80+ );
6881 }
6982
7083 @ Override
@@ -107,28 +120,29 @@ private static class IgnoredSourceRowStrideReader<T> implements RowStrideReader
107120 // Contains name of the field and all its parents
108121 private final Set <String > fieldPaths ;
109122 private final Reader <T > reader ;
110- private final IgnoredSourceFieldMapper .IgnoredSourceFormat ignoredSourceFormat ;
123+ private final IgnoredSourceFieldMapper .IgnoredSourceLeafLoader ignoredSourceLeafLoader ;
111124
112125 IgnoredSourceRowStrideReader (
113126 CircuitBreaker breaker ,
114127 String fieldName ,
115128 Set <String > fieldPaths ,
116129 Reader <T > reader ,
117- IgnoredSourceFieldMapper .IgnoredSourceFormat ignoredSourceFormat
130+ IgnoredSourceFieldMapper .IgnoredSourceLeafLoader ignoredSourceLeafLoader
118131 ) {
119132 breaker .addEstimateBytesAndMaybeBreak (ESTIMATED_SIZE , "load blocks" );
120133 this .breaker = breaker ;
121134 this .fieldName = fieldName ;
122135 this .fieldPaths = fieldPaths ;
123136 this .reader = reader ;
124- this .ignoredSourceFormat = ignoredSourceFormat ;
137+ this .ignoredSourceLeafLoader = ignoredSourceLeafLoader ;
125138 }
126139
127140 @ Override
128141 public void read (int docId , StoredFields storedFields , Builder builder ) throws IOException {
129- Map <String , List <IgnoredSourceFieldMapper .NameValue >> valuesForFieldAndParents = ignoredSourceFormat .loadSingleIgnoredField (
142+ Map <String , List <IgnoredSourceFieldMapper .NameValue >> valuesForFieldAndParents = ignoredSourceLeafLoader .loadSingleIgnoredField (
130143 fieldPaths ,
131- storedFields .storedFields ()
144+ storedFields .storedFields (),
145+ docId
132146 );
133147
134148 if (valuesForFieldAndParents .isEmpty ()) {
0 commit comments