Internal: use 1 instead of 0 as filler version value for nested docs

This commit is contained in:
Robert Muir 2014-10-17 15:14:54 -04:00
parent 4723c2a2ee
commit 5d53d03c2d

View File

@ -131,11 +131,11 @@ public class VersionFieldMapper extends AbstractFieldMapper<Long> implements Int
@Override
public void postParse(ParseContext context) throws IOException {
// In the case of nested docs, let's fill nested docs with version=0 so that Lucene doesn't write a Bitset for documents
// that don't have the field
// In the case of nested docs, let's fill nested docs with version=1 so that Lucene doesn't write a Bitset for documents
// that don't have the field. This is consistent with the default value for efficiency.
for (int i = 1; i < context.docs().size(); i++) {
final Document doc = context.docs().get(i);
doc.add(new NumericDocValuesField(NAME, 0L));
doc.add(new NumericDocValuesField(NAME, 1L));
}
}