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

Create dedicated fielddata implementation for boolean fields #4678

Closed
uboness opened this issue Jan 10, 2014 · 4 comments · Fixed by #7961
Closed

Create dedicated fielddata implementation for boolean fields #4678

uboness opened this issue Jan 10, 2014 · 4 comments · Fixed by #7961

Comments

@uboness
Copy link
Contributor

uboness commented Jan 10, 2014

Just like we have for bytes & numerics, we should have a dedicated field data implementation for boolean values. This will be much more optimized memory-wise and overall performance-wise than what we have today (today, we treat booleans as bytes - T & F)

This will also solve the formatting issues in the different APIs (eg. facets & aggregations) where instead of returning T & F we'll be able to return true & false.

related to: #2462

@ghost ghost assigned jpountz Jan 10, 2014
@kevinkluge kevinkluge added v1.1.0 and removed v1.0.1 labels Feb 11, 2014
@s1monw s1monw added v1.2.0 and removed v1.1.0 labels Mar 20, 2014
@jpountz jpountz added v1.3.0 and removed v1.2.0 labels May 7, 2014
jpountz added a commit to jpountz/elasticsearch that referenced this issue May 7, 2014
This will ensure that facets and aggregations display them as true/false
instead of T/F.

Close elastic#4678
@jpountz jpountz added v1.3.0 and removed v1.2.0 labels May 7, 2014
@clintongormley
Copy link

@uboness any news on this issue?

@uboness
Copy link
Contributor Author

uboness commented Jul 4, 2014

I believe @jpountz did some relevant work

@jpountz
Copy link
Contributor

jpountz commented Jul 4, 2014

I still need to figure out whether we actually need a custom boolean field data API, or if only a different implementation would be required (using eg. the numeric API) and customizing the formatting in aggregations like we already do eg. for ip addresses or dates. I would lean towards the latter option. This will also help integration with Lucene APIs and eg. allow to have doc values support without any adapter.

@clintongormley
Copy link

Also see #7851

jpountz added a commit to jpountz/elasticsearch that referenced this issue Apr 2, 2015
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants