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
Add doc values support to boolean fields. #7961
Conversation
@jpountz this looks good to me but I think we need to make sure that then |
@s1monw I pushed a new commit that only switches to this new field data on new indices. That said, I'm wondering if that is the right trade-off:
Another option is to only push this change to 2.0? |
After discussing this with @s1monw I made the change 2.0-only. |
9845f29
to
9f44137
Compare
@s1monw I updated the 2.0 migration guide with the breaking change for boolean fields. |
Similar to what @rjernst did in #8013 I think I'd really like to see this to be tested against an old index. See https://github.com/elasticsearch/elasticsearch/pull/8013/files#diff-ec2b53cfb6bd9c938d5a48d14a34b609R43 otherwise LGTM |
@s1monw There used to be a backward compatibility test (jpountz@9700deb#diff-8) but I removed it when I made this change 2.0-only since we cannot run clusters that contain both 1.x and 2.0 nodes. |
I don't think so while it applies to that too :) I think we should check that we can upgrade an existing boolean field or at least handle it just fine if somebody does a full restart with 2.0 |
9f44137
to
7b9119b
Compare
@s1monw This PR has been stalled for some time so I rebased it to a recent master and added the bw compat tests that you were asking for. Could you take another look? Note that I only regenerated the static bw index for 1.5 for now but I will need to do it for all versions before pushing if I don't want to break the bw tests. |
@rjernst You might want to have a look at this one too as I know you've done a lot of stuff recently around bw compat testing and mappings. |
LGTM |
This pull request makes boolean handled like dates and ipv4 addresses: things are stored as as numerics under the hood and aggregations add some special formatting logic in order to return true/false in addition to 1/0. For example, here is an output of a terms aggregation on a boolean field: ``` "aggregations": { "top_f": { "doc_count_error_upper_bound": 0, "buckets": [ { "key": 0, "key_as_string": "false", "doc_count": 2 }, { "key": 1, "key_as_string": "true", "doc_count": 1 } ] } } ``` Sorted numeric doc values are used under the hood. Close elastic#4678 Close elastic#7851
7b9119b
to
08f93cf
Compare
Fielddata: Add doc values support to boolean fields. Close #7961
This pull request makes boolean handled like dates and ipv4 addresses: things
are stored as as numerics under the hood and aggregations add some special
formatting logic in order to return true/false in addition to 1/0.
For example, here is an output of a terms aggregation on a boolean field:
Sorted numeric doc values are used under the hood.
Close #4678
Close #7851