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

Change coerce and range query behavior #27219

Closed
wants to merge 5 commits into from
Closed

Conversation

PnPie
Copy link
Contributor

@PnPie PnPie commented Nov 1, 2017

This change includes:

  1. coerce option currently only cast string to number, and doesn't cast float/double to byte/short/integer/long (by truncating decimal part).

  2. The "numeric range" of a range query doesn't depend on the "range" of field type (ex. integer/long) anymore, that means for example for a BYTE field we can do a range query on [1.5 to 200] (equivalent to [2 to 127]) because it also makes sense.

For the option of truncate/floor/ceil/round number, we can create a new processor to do it ?

Relates to #25861

Make the "coerce" option only accepting strings, and not truncating
decimal part of a floating number for BYTE, SHORT, INTEGER and LONG any
more.
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@tomcallahan
Copy link
Contributor

@jpountz

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@jpountz
Copy link
Contributor

jpountz commented Apr 4, 2018

My preference is that coercedoesn't apply to the query side at all and that we try to do the right thing automatically. For instance [ -2.67 TO 300 ]on a byte field would be equivalent to [ -2 TO 127 ]. This way on the query side you only have to care about the fact that the field is mapped as a number, not its actual type.

I do agree with you that we should try to implement rounding/truncating processors as well at the same time for users who need this kind of functionality.

Also for the record some disagreement was expressed on the issue regarding

@PnPie PnPie changed the title Make coerce only accepting strings Change coerce and range query behavior Apr 15, 2018
@PnPie
Copy link
Contributor Author

PnPie commented Apr 15, 2018

Hello @jpountz
I do agree with you on the range query part because it's does make sense. I updated the PR and also the description on first comment.

@colings86 colings86 added >breaking :Search/Mapping Index mappings, including merging and defining field types labels Apr 24, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@javanna
Copy link
Member

javanna commented Aug 16, 2018

heya @jpountz I think your last comment was cut around the disagreement. What should we do with this PR?

@jimczi
Copy link
Contributor

jimczi commented Jan 11, 2019

We discussed in FixItFriday and decided to close this pr for now. The query part should not be affected by the removal of the coerce option. Moreover we need to make the removal more friendly to users, that means only applying the new rule to new indices created in the version that removed the option. 7.0 is close and we don't have the processors for rounding/truncating so we should postpone the removal to a future version (8.0).

@jimczi jimczi closed this Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Search/Mapping Index mappings, including merging and defining field types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants