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

[indexPatterns/field] remove indexed/analyzed/doc_values awareness #11969

Merged
merged 5 commits into from
May 25, 2017

Conversation

spalger
Copy link
Contributor

@spalger spalger commented May 23, 2017

With #11114 we will no longer be able to depend on access to the field mappings, meaning that the field objects will no longer have field.indexed, field.analyzed, or field.doc_values properties. In place of these properties fields will get a field.readFromDocValues property that will indicate which fields should be accessed using docvalue_fields when reading the field on documents in elasticsearch.

See #11141 for reasoning behind how readFromDocValues is calculated.

@spalger spalger requested review from w33ble and Bargs May 23, 2017 01:36
@spalger spalger added blocked and removed review labels May 23, 2017
@spalger spalger force-pushed the index-patterns/read-from-doc-values branch from de99c16 to 334ebfc Compare May 24, 2017 02:25
@spalger spalger requested review from kimjoar and epixa and removed request for w33ble and Bargs May 24, 2017 16:59
@spalger spalger force-pushed the index-patterns/read-from-doc-values branch from 6c8a36d to 23a30a6 Compare May 24, 2017 23:20
@spalger spalger added review and removed blocked labels May 24, 2017
'missing',
'name'
],
defaults: {
missing: true
missing: true,
type: 'any'
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the benefit of any over null or undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the value rendered in the UI. This is master:

image

@@ -45,7 +44,8 @@ export function AggTypesMetricsTopHitProvider(Private) {
}
};
} else {
if (field.doc_values) {
// https://git.io/vSPvJ
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just the real github url here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Habit, linking to specific lines of specific files in specific commits is over 120 characters in many cases, no reason this can't be there though.

Object.defineProperties(Field.prototype, {
indexed: {
get() {
throw new Error('field.indexed has been removed.');
Copy link
Contributor

Choose a reason for hiding this comment

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

Whenever we remove features and want to have messages like this, we should maybe follow a pattern like "X has been removed, use Y instead" or "X has been removed, see github.com/Y" to be more helpful

}

return indexPattern.fields.every(field => {
// added in 5.0 #8421
Copy link
Contributor

Choose a reason for hiding this comment

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

First time I've seen this kind of comment in Kibana (but that might just be because I haven't looked at much code yet). Is there a specific reason for this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure there are a couple places like this. The main reason I would but these types of comments in is that these lines are here for backwards compatibility, so if we want to remove/edit them we need to consider when they were added. It's not a ton different than most things, but having a note for why this somewhat strange series of checks exists is nothing but helpful if you ask me.

Copy link
Contributor

Choose a reason for hiding this comment

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

++ I agree. Enough to link to the PR, e.g. "Added in #x"? (So we don't have the diff between "added in" and "slotted for"). The PR will have the details about version and why it's added etc.


if (!hasFieldCaps || !hasDocValuesFlag) {
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just return !hasFieldCaps || !hasDocValuesFlag, no point in having the if

Copy link
Contributor

@epixa epixa left a comment

Choose a reason for hiding this comment

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

LGTM

@spalger spalger merged commit 84ea502 into elastic:master May 25, 2017
spalger added a commit that referenced this pull request May 25, 2017
…11969)

* [indexPatterns/field] replace mapping awareness with readFromDocValues

* move link to more details to proper location

* Address kjbekkelund's feedback

* let the prs speak for themselves

(cherry picked from commit 84ea502)
snide pushed a commit to snide/kibana that referenced this pull request May 30, 2017
…lastic#11969)

* [indexPatterns/field] replace mapping awareness with readFromDocValues

* move link to more details to proper location

* Address kjbekkelund's feedback

* let the prs speak for themselves
@spalger spalger deleted the index-patterns/read-from-doc-values branch October 18, 2019 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants