|
@@ -70,19 +70,16 @@ public abstract class FallbackSyntheticSourceBlockLoader implements BlockLoader
|
|
|
throw new UnsupportedOperationException();
|
|
|
}
|
|
|
|
|
|
- private record IgnoredSourceRowStrideReader<T>(String fieldName, Reader<T> reader) implements RowStrideReader {
|
|
|
- @Override
|
|
|
- public void read(int docId, StoredFields storedFields, Builder builder) throws IOException {
|
|
|
- var ignoredSource = storedFields.storedFields().get(IgnoredSourceFieldMapper.NAME);
|
|
|
- if (ignoredSource == null) {
|
|
|
- builder.appendNull();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, List<IgnoredSourceFieldMapper.NameValue>> valuesForFieldAndParents = new HashMap<>();
|
|
|
-
|
|
|
- // Contains name of the field and all its parents
|
|
|
- Set<String> fieldNames = new HashSet<>() {
|
|
|
+ private static class IgnoredSourceRowStrideReader<T> implements RowStrideReader {
|
|
|
+ // Contains name of the field and all its parents
|
|
|
+ private final Set<String> fieldNames;
|
|
|
+ private final String fieldName;
|
|
|
+ private final Reader<T> reader;
|
|
|
+
|
|
|
+ IgnoredSourceRowStrideReader(String fieldName, Reader<T> reader) {
|
|
|
+ this.fieldName = fieldName;
|
|
|
+ this.reader = reader;
|
|
|
+ this.fieldNames = new HashSet<>() {
|
|
|
{
|
|
|
add("_doc");
|
|
|
}
|
|
@@ -97,6 +94,18 @@ public abstract class FallbackSyntheticSourceBlockLoader implements BlockLoader
|
|
|
fieldNames.add(current.toString());
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void read(int docId, StoredFields storedFields, Builder builder) throws IOException {
|
|
|
+ var ignoredSource = storedFields.storedFields().get(IgnoredSourceFieldMapper.NAME);
|
|
|
+ if (ignoredSource == null) {
|
|
|
+ builder.appendNull();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, List<IgnoredSourceFieldMapper.NameValue>> valuesForFieldAndParents = new HashMap<>();
|
|
|
+
|
|
|
for (Object value : ignoredSource) {
|
|
|
IgnoredSourceFieldMapper.NameValue nameValue = IgnoredSourceFieldMapper.decode(value);
|
|
|
if (fieldNames.contains(nameValue.name())) {
|