-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-13340: Allow adding a parent field to an index with no fields #13341
Conversation
hm maybe this is not safe? If one creates a doc block filled with empty documents? I'm not sure ... OTOH if they have no fields how can it ever matter what one does with them?! |
I'll push since there don't seem to be any concerns raised. If we later want to make the index metadata a first-class file on its own we can always do that. |
Would it be possible to back-port this fix to v.9.11? I did hit this issue as well while trying to make use of #12829. |
I don't think we can backport to 9.11 since it has already been released, but I will backport to 9.x and then it should get released with the next. There was some talk about a 9.11.1, so maybe it would be in that? |
That would be nice, thanks. @jpountz @benwtrent fyi. |
sigh, I would have backported right away except for some reason I thought the parent-field enforcement was only on 10.x not 9.x |
This PR piggy-backs on recent changes in Lucene 9.11.1 (apache/lucene#12829, apache/lucene#13341), setting the parent doc when nested fields are present. This allows moving nested documents along with parent ones during sorting. With this change, sorting is now allowed on fields outside nested objects. Sorting on fields within nested objects is still not supported (throws an exception). Fixes #107349
Addresses #13340 . It relaxes the previous rule that adding a parent field to an existing index is always forbidden, allowing it in the case where no fields have been created. In such a case it will be safe, and this enables the trivial case of opening and closing a new empty index twice to work in a sensible way.