-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Changes from 1 commit
23a30a6
beaed69
f708d6c
ecc16c4
cefd8ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function shouldReadFieldFromDocValues(aggregatable, esType) { | ||
return aggregatable && esType !== 'text' && !esType.startsWith('_'); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ export function AggTypesMetricsTopHitProvider(Private) { | |
{ | ||
name: 'field', | ||
onlyAggregatable: false, | ||
showAnalyzedWarning: false, | ||
filterFieldTypes: function (vis, value) { | ||
if (vis.type.name === 'table' || vis.type.name === 'metric') { | ||
return true; | ||
|
@@ -45,7 +44,8 @@ export function AggTypesMetricsTopHitProvider(Private) { | |
} | ||
}; | ||
} else { | ||
if (field.doc_values) { | ||
// https://git.io/vSPvJ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just the real github url here? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
if (field.readFromDocValues) { | ||
output.params.docvalue_fields = [ field.name ]; | ||
} | ||
output.params._source = field.name === '_source' ? true : field.name; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ export function IndexPatternsFieldProvider(Private, shortDotsFilter, $rootScope, | |
const scripted = !!spec.scripted; | ||
const searchable = !!spec.searchable || scripted; | ||
const aggregatable = !!spec.aggregatable || scripted; | ||
const readFromDocValues = !!spec.readFromDocValues && !scripted; | ||
const sortable = spec.name === '_score' || ((indexed || aggregatable) && type.sortable); | ||
const filterable = spec.name === '_id' || scripted || ((indexed || searchable) && type.filterable); | ||
const visualizable = aggregatable; | ||
|
@@ -55,14 +56,10 @@ export function IndexPatternsFieldProvider(Private, shortDotsFilter, $rootScope, | |
obj.writ('script', scripted ? spec.script : null); | ||
obj.writ('lang', scripted ? (spec.lang || 'painless') : null); | ||
|
||
// mapping info | ||
obj.fact('indexed', indexed); | ||
obj.fact('analyzed', !!spec.analyzed); | ||
obj.fact('doc_values', !!spec.doc_values); | ||
|
||
// stats | ||
obj.fact('searchable', searchable); | ||
obj.fact('aggregatable', aggregatable); | ||
obj.fact('readFromDocValues', readFromDocValues); | ||
|
||
// usage flags, read-only and won't be saved | ||
obj.comp('format', format); | ||
|
@@ -81,6 +78,24 @@ export function IndexPatternsFieldProvider(Private, shortDotsFilter, $rootScope, | |
return obj.create(); | ||
} | ||
|
||
Object.defineProperties(Field.prototype, { | ||
indexed: { | ||
get() { | ||
throw new Error('field.indexed has been removed.'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
} | ||
}, | ||
analyzed: { | ||
get() { | ||
throw new Error('field.analyzed has been removed.'); | ||
} | ||
}, | ||
doc_values: { | ||
get() { | ||
throw new Error('field.doc_values has been removed.'); | ||
} | ||
}, | ||
}); | ||
|
||
Field.prototype.routes = { | ||
edit: '/management/kibana/indices/{{indexPattern.id}}/field/{{name}}' | ||
}; | ||
|
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.
What's the benefit of
any
overnull
orundefined
?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.
That's the value rendered in the UI. This is master: