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

[Lens] Add support for scripted fields and aliases to the existence API #54064

Merged
merged 16 commits into from
Jan 14, 2020

Conversation

chrisdavies
Copy link
Contributor

@chrisdavies chrisdavies commented Jan 6, 2020

Currently, scripted fields and aliases are always hidden unless the user selects "show all fields". This fixes that by handling scripted fields and aliases in the Lens field existence API.

Release note

Lens now lets you use scripted fields and alias fields.

@chrisdavies
Copy link
Contributor Author

@elasticmachine merge upstream

@chrisdavies
Copy link
Contributor Author

@elasticmachine merge upstream

@chrisdavies
Copy link
Contributor Author

@elasticmachine merge upstream

@wylieconlon
Copy link
Contributor

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

toDate?: string;
fields: Field[];
}) {
if (!timeFieldName || !fromDate || !toDate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using timeFieldName is a bug, but I will try to fix this later #53666

mappings,
fieldDescriptors,
};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to see the performance hit of this, it's a bit worrying that it uses 3 network requests to get the index pattern data, and a 4th to get the existence info.

@wylieconlon
Copy link
Contributor

Okay, so alias fields work fine but scripted fields show no data. The performance impact looks minimal.

Screenshot 2020-01-14 12 22 32

name: field.name,
isScript: !!field.scripted,
isAlias: !!aliasMap[field.name],
path: path.split('.'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're allowed to have dots in field names without being nested, but it works fine for most use.

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and code LGTM with comments. I will follow up to try to address the time field issue.

@wylieconlon wylieconlon merged commit 79054af into elastic:master Jan 14, 2020
@wylieconlon wylieconlon added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 labels Jan 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

wylieconlon pushed a commit to wylieconlon/kibana that referenced this pull request Jan 14, 2020
…PI (elastic#54064)

* Add support for scripted fields and
default index pattern

* Add scripted fields and aliases to existence API

* Fix TypeScript errors.

* Fix mappings parsing

* Default to the index pattern timeFieldName

Co-authored-by: Elastic Machine <[email protected]>
wylieconlon pushed a commit that referenced this pull request Jan 14, 2020
…PI (#54064) (#54771)

* Add support for scripted fields and
default index pattern

* Add scripted fields and aliases to existence API

* Fix TypeScript errors.

* Fix mappings parsing

* Default to the index pattern timeFieldName

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Chris Davies <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 17, 2020
…PI (elastic#54064)

* Add support for scripted fields and
default index pattern

* Add scripted fields and aliases to existence API

* Fix TypeScript errors.

* Fix mappings parsing

* Default to the index pattern timeFieldName

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants