Skip to content
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

Merged
merged 1 commit into from
May 6, 2024

Conversation

msokolov
Copy link
Contributor

@msokolov msokolov commented May 2, 2024

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.

@msokolov
Copy link
Contributor Author

msokolov commented May 2, 2024

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?!

@msokolov
Copy link
Contributor Author

msokolov commented May 6, 2024

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.

@msokolov msokolov merged commit 30da7da into apache:main May 6, 2024
3 checks passed
@msokolov msokolov deleted the gh-13340 branch May 6, 2024 16:53
@kkrik-es
Copy link

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.

msokolov added a commit to msokolov/lucene that referenced this pull request Jun 13, 2024
@msokolov
Copy link
Contributor Author

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?

@msokolov msokolov added this to the 9.12.0 milestone Jun 13, 2024
@kkrik-es
Copy link

That would be nice, thanks. @jpountz @benwtrent fyi.

@benwtrent
Copy link
Member

@msokolov it might be worth doing a 9.11.1 release to fix this particular bug and maybe another other one: #13475

I didn't know about this outstanding bug (parent field with empty index) when I originally did the 9.11 release, I should have investigated.

@msokolov
Copy link
Contributor Author

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

benwtrent added a commit that referenced this pull request Jun 18, 2024
) (#13483) (#13504)

* gh-13340: Allow adding a parent field to an index with no fields (#13341) (#13483)

* adding 9.11.1 changes

---------

Co-authored-by: Michael Sokolov <[email protected]>
elasticsearchmachine pushed a commit to elastic/elasticsearch that referenced this pull request Jul 1, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants