-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Enforce a limit on the depth of the JSON object. #35063
Enforce a limit on the depth of the JSON object. #35063
Conversation
Pinging @elastic/es-search-aggs |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Couple of thoughts on this:
|
I like the spirit of this PR, allowing you to store complex object graphs without exploding the mappings. I wonder if this usecase is best served through a dedicated mapping type instead? e.g given a document:
A user would be able to say map my |
@Mpdreamz Note that this is already a dedicated field type, as this is for the queryable object fields feature: #25312 We do have a line of confusion here in that we keep talking about this feature as "object fields" which we should change since we already have the concept of "object fields" in Elasticsearch. We should try to come up with a better name for this new field |
Totally missed #25312 is moving ahead! Awesome, really looking forward to this feature. Agreed on naming anything other then |
@colings86 would you be able to give more detail on why a single mapping depth limit would be preferable? I don't have great context on what @Mpdreamz thanks for keeping us on top of things :) I'm brainstorming a new name for these fields. |
74a56e9
to
77d99aa
Compare
77d99aa
to
7a2750a
Compare
@jtibshirani my thinking of keeping it as a single mapping depth limit was to simplify thing for the user so they only need to reason about the depth of the JSON in their documents and not have to worry about whether certain parts of the JSON are allowed to nested deeper than other parts. I think the main reason for adding Given the above I'm happy for us to have separate settings if you still think thats the better way to go since there is a good argument for why |
@colings86 thanks for the explanation, in that case I do think having separate options makes sense here. For now I'm planning to skip adding a 'lenient' mode, as I'd like to get more usage feedback before adding another config option. Merging, but let me know if you have other thoughts and I can address them in a follow-up. |
Currently, we error if a JSON field could contain fields deeper than the configured limit. The default value is 20, which matches
index.mapping.depth.limit
).I was also wondering if it made sense to introduce a 'lenient' mode, in the general spirit of
ignore_malformed
. A couple options: