-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Allow sorting and filtering on _type field #10254
Changes from 4 commits
e1d3dae
4e39c31
6362953
0f70647
91dbc3e
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 |
---|---|---|
|
@@ -40,10 +40,10 @@ export default function FieldObjectProvider(Private, shortDotsFilter, $rootScope | |
|
||
const indexed = !!spec.indexed; | ||
const scripted = !!spec.scripted; | ||
const sortable = spec.name === '_score' || ((indexed || scripted) && type.sortable); | ||
const filterable = spec.name === '_id' || scripted || (indexed && type.filterable); | ||
const searchable = !!spec.searchable || scripted; | ||
const aggregatable = !!spec.aggregatable || scripted; | ||
const sortable = spec.name === '_score' || ((indexed || scripted || aggregatable) && type.sortable); | ||
const filterable = spec.name === '_id' || scripted || ((indexed || searchable) && type.filterable); | ||
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. This is probably me not knowing enough about the various 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. Yeah, you're reading that correctly. It's been that way for quite awhile though. I'm not sure if it's intentional or just a side effect of the code evolving over time. Given that filtering and sorting are two very different operations in ES, I wouldn't be totally surprised if there's some subtlety at play here. |
||
const visualizable = aggregatable; | ||
|
||
obj.fact('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.
It looks like
aggregatable
impliesscripted || aggregatable
, soscripted
could be left out here.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.
Good point!
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.
Updated.