Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,16 @@ public SortedSetDocValues ordinals(LeafReaderContext context) throws IOException
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");
}
Expand All @@ -97,6 +94,18 @@ public void read(int docId, StoredFields storedFields, Builder builder) throws I
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())) {
Expand Down