Skip to content

Comments

[5.1] Fix sorting on scripted date and boolean fields#9285

Merged
epixa merged 1 commit into5.1from
jasper/backport/9261/5.1
Nov 30, 2016
Merged

[5.1] Fix sorting on scripted date and boolean fields#9285
epixa merged 1 commit into5.1from
jasper/backport/9261/5.1

Conversation

@elastic-jasper
Copy link
Contributor

Fix sorting on scripted date and boolean fields

Backports PR #9261

Commit 1:
Fix sorting on scripted date and boolean fields

The elasticsearch API only supports2 sort scripts of type number and
string. Since dates need to be returned as millis since the epoch for
visualizations to work anyway, we can simply add a condition to send dates
as type number in the sort API. ES will cast booleans if we tell them
its a string, so we can add a similar condition there as well.

Fixes: #9257

Commit 2:
Add helpful comment

Backports PR #9261

**Commit 1:**
Fix sorting on scripted date and boolean fields

The elasticsearch API only [supports][1][2] sort scripts of type `number` and
`string`. Since dates need to be returned as millis since the epoch for
visualizations to work anyway, we can simply add a condition to send dates
as type number in the sort API. ES will cast booleans if we tell them
its a string, so we can add a similar condition there as well.

[1]: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-sort.html#_script_based_sorting
[2]: https://github.com/elastic/elasticsearch/blob/aeb97ff41298e26b107a733837dfe17f123c0c9b/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java#L359

Fixes: #9257

* Original sha: 0d5a824
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-29T21:05:48Z

**Commit 2:**
Add helpful comment

* Original sha: 14dc396
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-30T21:02:41Z
@elastic-jasper elastic-jasper added the backport This PR is a backport of another PR label Nov 30, 2016
@epixa epixa merged commit b5ae727 into 5.1 Nov 30, 2016
@epixa epixa deleted the jasper/backport/9261/5.1 branch November 30, 2016 21:15
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Backports PR elastic#9261

**Commit 1:**
Fix sorting on scripted date and boolean fields

The elasticsearch API only [supports][1][2] sort scripts of type `number` and
`string`. Since dates need to be returned as millis since the epoch for
visualizations to work anyway, we can simply add a condition to send dates
as type number in the sort API. ES will cast booleans if we tell them
its a string, so we can add a similar condition there as well.

[1]: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-sort.html#_script_based_sorting
[2]: https://github.com/elastic/elasticsearch/blob/aeb97ff41298e26b107a733837dfe17f123c0c9b/core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java#L359

Fixes: elastic#9257

* Original sha: 0d5a824
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-29T21:05:48Z

**Commit 2:**
Add helpful comment

* Original sha: 14dc396
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-30T21:02:41Z
Former-commit-id: b5ae727
tkajtoch added a commit that referenced this pull request Jan 20, 2026
## Dependency updates

- `@elastic/eui`: `v111.1.0` ⏩ `v112.0.0`
- `@elastic/eslint-plugin-eui`: `v2.6.0` ⏩ `v2.7.0`

---

## Package updates

### `@elastic/eui`
[v112.0.0](https://github.com/elastic/eui/releases/tag/v112.0.0)

- Added `productDiscover` icon
([#9311](elastic/eui#9311))
- Updated `chartGauge` icon glyph
([#9311](elastic/eui#9311))
- Updated icon glyphs `endpoint` `eraser` `errorFill` `error` `eyeSlash`
`faceHappy` `faceNeutral` `faceSad` `folder` `fullScreenExit`
`fullScreen` `gradient` `grid` `heart` `home` `if` `image` `infinity`
`inputOutput` `key` `keyboard` `lineBreakSlash` `lineBreak` `lineDash`
`lineDot` `lineSolid` `logOut` `magnifyMinus` `magnifyPlus` `magnify`
`mail` `map` `mapping` `menuLeft` `menuRight` `menu` `merge`
`minusCircle` `minusSquare` `minus` `money` `moon` `move` `nested`
`number` `package` `paintBucket` `palette` `paperClip` `partial`
`pattern` `pause` `pencil` `percent` `pinFill` `pin` `pivot`
`plusCircle` `plusSquare` `plus` `popper` `presentation` `processor`
`productStreamsWired` `queryField` `queryOperand` `querySelector`
`queryValue` `query` `question` `quote` `radar` `readOnly` `redo`
`reporter` `return` `rocket` `scissors` `send` `shard` `share`
`snowflake` `sortAscending` `sortDescending` `starFill` `star` `stop`
`sun` `tableInfo` `tableTime` `textAlignCenter` `textAlignLeft`
`textAlignRight` `textBold` `textHeading` `textItalic` `textStrike`
`textUnderline` `thermometer` `thumbDown` `thumbUp` `timeline`
`transitionLeftIn` `transitionLeftOut` `transitionTopIn`
`transitionTopOut` `undo` `vectorSquare` `vectorTriangle` `videoPlayer`
`warningFill` `waypoint` `wifiSlash` `wifi`
([#9303](elastic/eui#9303))
 ([#9303](elastic/eui#9303))
- Added icons - `archive` `unarchive` `axisX` `axisYLeft` `axisYRight`
`bulb` `cloud` `hourglass` `megaphone` `workflow`
([#9303](elastic/eui#9303))
- Added `headerVisibility` prop on `EuiDataGrid` to support rendering
the datagrid header element optionally
([#9281](elastic/eui#9281))
- Updated 244 icon definitions to a more consistent naming convention.
All 100 renamed icons include a backward-compatible alias in the icon
map to support legacy references.
([#9279](elastic/eui#9279))
- Added icons `briefcase`, `productCloudInfra`, `productDashboard`,
`productML` ([#9301](elastic/eui#9301))
- Updated glyphs `bullseye`, `bolt`
([#9301](elastic/eui#9301))
- Added `dismissButtonProps` prop to `EuiCallOut`
([#9285](elastic/eui#9285))

**Bug fixes**

- Fixed `EuiFlyout` to properly forward refs when `session` prop is
used. ([#9318](elastic/eui#9318))
- Fixed `EuiDataGrid` cells scrolling into view while trying to select
text ([#9276](elastic/eui#9276))

**Breaking changes**

- Removed `euiPaletteForLightBackground` and
`euiPaletteForDarkBackground` deprecated palette functions. Use
`euiTheme.colors.vis.euiColorVisText{NUMBER}` tokens instead.
([#9296](elastic/eui#9296))

**Accessibility**

- Improved the accessibility of `EuiDataGrid`s column selector drag
handle buttons by ensuring distinctive labels
([#9282](elastic/eui#9282))

### `@elastic/eslint-plugin-eui` v2.7.0

- Added `no-static-z-index` rule
([#9236](elastic/eui#9236))
dennis-tismenko pushed a commit to dennis-tismenko/kibana that referenced this pull request Jan 22, 2026
## Dependency updates

- `@elastic/eui`: `v111.1.0` ⏩ `v112.0.0`
- `@elastic/eslint-plugin-eui`: `v2.6.0` ⏩ `v2.7.0`

---

## Package updates

### `@elastic/eui`
[v112.0.0](https://github.com/elastic/eui/releases/tag/v112.0.0)

- Added `productDiscover` icon
([elastic#9311](elastic/eui#9311))
- Updated `chartGauge` icon glyph
([elastic#9311](elastic/eui#9311))
- Updated icon glyphs `endpoint` `eraser` `errorFill` `error` `eyeSlash`
`faceHappy` `faceNeutral` `faceSad` `folder` `fullScreenExit`
`fullScreen` `gradient` `grid` `heart` `home` `if` `image` `infinity`
`inputOutput` `key` `keyboard` `lineBreakSlash` `lineBreak` `lineDash`
`lineDot` `lineSolid` `logOut` `magnifyMinus` `magnifyPlus` `magnify`
`mail` `map` `mapping` `menuLeft` `menuRight` `menu` `merge`
`minusCircle` `minusSquare` `minus` `money` `moon` `move` `nested`
`number` `package` `paintBucket` `palette` `paperClip` `partial`
`pattern` `pause` `pencil` `percent` `pinFill` `pin` `pivot`
`plusCircle` `plusSquare` `plus` `popper` `presentation` `processor`
`productStreamsWired` `queryField` `queryOperand` `querySelector`
`queryValue` `query` `question` `quote` `radar` `readOnly` `redo`
`reporter` `return` `rocket` `scissors` `send` `shard` `share`
`snowflake` `sortAscending` `sortDescending` `starFill` `star` `stop`
`sun` `tableInfo` `tableTime` `textAlignCenter` `textAlignLeft`
`textAlignRight` `textBold` `textHeading` `textItalic` `textStrike`
`textUnderline` `thermometer` `thumbDown` `thumbUp` `timeline`
`transitionLeftIn` `transitionLeftOut` `transitionTopIn`
`transitionTopOut` `undo` `vectorSquare` `vectorTriangle` `videoPlayer`
`warningFill` `waypoint` `wifiSlash` `wifi`
([elastic#9303](elastic/eui#9303))
 ([elastic#9303](elastic/eui#9303))
- Added icons - `archive` `unarchive` `axisX` `axisYLeft` `axisYRight`
`bulb` `cloud` `hourglass` `megaphone` `workflow`
([elastic#9303](elastic/eui#9303))
- Added `headerVisibility` prop on `EuiDataGrid` to support rendering
the datagrid header element optionally
([elastic#9281](elastic/eui#9281))
- Updated 244 icon definitions to a more consistent naming convention.
All 100 renamed icons include a backward-compatible alias in the icon
map to support legacy references.
([elastic#9279](elastic/eui#9279))
- Added icons `briefcase`, `productCloudInfra`, `productDashboard`,
`productML` ([elastic#9301](elastic/eui#9301))
- Updated glyphs `bullseye`, `bolt`
([elastic#9301](elastic/eui#9301))
- Added `dismissButtonProps` prop to `EuiCallOut`
([elastic#9285](elastic/eui#9285))

**Bug fixes**

- Fixed `EuiFlyout` to properly forward refs when `session` prop is
used. ([elastic#9318](elastic/eui#9318))
- Fixed `EuiDataGrid` cells scrolling into view while trying to select
text ([elastic#9276](elastic/eui#9276))

**Breaking changes**

- Removed `euiPaletteForLightBackground` and
`euiPaletteForDarkBackground` deprecated palette functions. Use
`euiTheme.colors.vis.euiColorVisText{NUMBER}` tokens instead.
([elastic#9296](elastic/eui#9296))

**Accessibility**

- Improved the accessibility of `EuiDataGrid`s column selector drag
handle buttons by ensuring distinctive labels
([elastic#9282](elastic/eui#9282))

### `@elastic/eslint-plugin-eui` v2.7.0

- Added `no-static-z-index` rule
([elastic#9236](elastic/eui#9236))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants