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

/_field_stats returns date values as strings #14404

Closed
spalger opened this issue Oct 30, 2015 · 2 comments
Closed

/_field_stats returns date values as strings #14404

spalger opened this issue Oct 30, 2015 · 2 comments
Assignees
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement v2.2.0

Comments

@spalger
Copy link
Contributor

spalger commented Oct 30, 2015

The max_value and min_value provided by the /_field_stats api currently provide strings values for date fields rather than milliseconds from epoch.

This feels like a bug to me, I expect them to resemble the results of a max or min aggregation:

/_field_stats

{
  // ...
  max_value: "2015-10-29T23:58:20.015Z"
  // ...
}

max aggregation:

{
  value: 1446163100015
  value_as_string: "2015-10-29T23:58:20.015Z"
}
@spalger spalger changed the title /_field_stats returns date values as formatted strings /_field_stats returns date values as strings Oct 30, 2015
@rashidkpc
Copy link

This is really important for post request sorting. ISO8601 will sort fine, but users that have alternative formats may find their strings don't sort as expected

spalger pushed a commit to spalger/kibana that referenced this issue Oct 30, 2015
@martijnvg
Copy link
Member

@spalger @rashidkpc Right, the data format being returned depends on the configuration in the date field in the mapping, but that isn't good for sorting, so lets change the format slightly to also include the milliseconds from epoch.

@martijnvg martijnvg self-assigned this Oct 31, 2015
@clintongormley clintongormley added >enhancement :Data Management/Indices APIs APIs to create and manage indices and templates v2.1.0 labels Nov 8, 2015
@martijnvg martijnvg added v2.2.0 and removed v2.1.0 labels Nov 11, 2015
martijnvg added a commit that referenced this issue Nov 23, 2015
…sponse elements for all number based fields. The existing `min_value` and `max_value` will return the values as numbers instead.

Closes #14404
spalger pushed a commit to spalger/kibana that referenced this issue Dec 10, 2015
spalger pushed a commit to elastic/kibana that referenced this issue Dec 11, 2015
spalger pushed a commit to elastic/kibana that referenced this issue Dec 11, 2015
spalger pushed a commit to elastic/kibana that referenced this issue Dec 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement v2.2.0
Projects
None yet
Development

No branches or pull requests

4 participants