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

Dynamically update "dynamic" field setting default value in Mappings Editor #98766

Open
cjcenizal opened this issue Apr 29, 2021 · 2 comments
Open
Labels
enhancement New value added to drive a business result Feature:Mappings Editor Index mappings editor UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@cjcenizal
Copy link
Contributor

Problem

Per conversation with @crisdarocha, if you set the index-level dynamic setting to false, this change isn't surfaced in the field-level dynamic setting:

image

image

What's confusing about this is that simply opening and closing the editor flyout for the field will affect the underlying ES request in confusing ways. If the user doesn't open the editor, the request doesn't specify a field-level dynamic setting, resulting in ES applying the index-level dynamic: false setting to this field:

image

However, if the user opens and closes the editor (without changing any settings), the request will specify a field-level dynamic: true setting, which results in ES different behavior than above:

image

Somewhat related to #52708, because this issue involves the application of ES defaults to the ES request.

Proposed solution

We can address this by dynamically (pun!) changing the dynamic field-level setting's default value, to match whatever has been set on index-level. This way when users edit a field they will see a default value for this setting that matches their expectations if they've changed the index-level setting. Per @sebelga this implementation should be straightforward. More time will be spent writing the tests than the implementation.

@cjcenizal cjcenizal added enhancement New value added to drive a business result Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more Feature:Mappings Editor Index mappings editor UI labels Apr 29, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@sebelga
Copy link
Contributor

sebelga commented Apr 29, 2021

I think we still need to address #52708 to solve this issue (stripping out any setting that has not been modified by the user. This should be done at the form lib level with an option on the form).

The reason is: there is the possibility for a user to

  1. Create an object, open the flyout, click save
  2. He now has dynamic: true on the object
  3. He changes the index level dynamic settings
  4. His initial object is still with dynamic: true

If we had stripped away the dynamic: true when clicking "Update" on the button, it would be undefined.

At this point the user can safely:

  • Turn off the index level dynamic setting
  • edit the object he created --> the dynamic toggle would now be off (once we have synced the defaultValue for the field to that value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Mappings Editor Index mappings editor UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

3 participants