mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Add doc values support to boolean fields.
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 #4678 Close #7851
This commit is contained in:
parent
e390ef5bc1
commit
08f93cf33f
99 changed files with 496 additions and 19 deletions
|
@ -61,7 +61,8 @@ def index_documents(es, index_name, type, num_docs):
|
|||
for id in range(0, num_docs):
|
||||
es.index(index=index_name, doc_type=type, id=id, body={'string': str(random.randint(0, 100)),
|
||||
'long_sort': random.randint(0, 100),
|
||||
'double_sort' : float(random.randint(0, 100))})
|
||||
'double_sort' : float(random.randint(0, 100)),
|
||||
'bool' : random.choice([True, False])})
|
||||
if rarely():
|
||||
es.indices.refresh(index=index_name)
|
||||
if rarely():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue