Closed msokolov closed 4 months ago
I hope someone who is familiar with this will quickly see the problem - I'm not sure if we (1) maybe fail to write any FieldInfos when the index is empty, but now we must, or (2) fail to notice that the index we just opened has no FieldInfos and therefore can have a parent field added? It makes more sense to me that we should write a FieldInfos for an empty index.
I tried removing
if (leaves.isEmpty()) {
return FieldInfos.EMPTY;
} else
from FieldInfos.getMergedFieldInfos
but this didn't fix it -- although it also might be needed?
OK, now I see that field infos is part of the segment so we would not have written it. I guess in this case we should explicitly recognize and work around the empty case.
@simonw of you get a moment, your perspective would be helpful. Should we be writing index metadata somewhere outside of a segment? Or tweak the hack we have...
Description
This test fails with
java.lang.IllegalArgumentException: can't add a parent field to an already existing index without a parent field
. If you index any documents in the index, using the parent field or no, then the test passes.Version and environment details
No response