# Problem in Visualizations after using "flattened" datatype

**URL:** <https://discuss.elastic.co/t/problem-in-visualizations-after-using-flattened-datatype/194584>\
**Category:** Kibana\
**Created:** [August 9, 2019, 10:02am UTC](https://discuss.elastic.co/t/problem-in-visualizations-after-using-flattened-datatype/194584 "2019-08-09T10:02:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JulGor](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@JulGor](https://discuss.elastic.co/u/JulGor)\
**Post date:** [August 9, 2019, 10:02am UTC](https://discuss.elastic.co/t/problem-in-visualizations-after-using-flattened-datatype/194584/1 "2019-08-09T10:02:47Z")

</div>

Hi,

I just started trying the new "flattened" datatype included in version 7.3 for a field that usually has to many children and I don't usually access them.

Here is an example of my documents:

order {  
id: XXX  
customer: { ... },  
items: { ... },  
total\_price: 150.0,  
transactions: {  
...  
receipt: { .... huge object ... }  
}  
}

Until now, I deleted the order.transactions.receipt field to avoid increase the "total\_fields" limit of my index settings but I thought that I could change that for setting this field as "flattened".

So I changed my mapping and index all the orders again and I didn't have any problem while indexing, so everything looked normal until I try to create a new visualization in Kibana.

For example, I tryed to calculate the total revenue in a "Metric" visualization by suming the values of the field "order.total\_price" but I got the following error:

> Request to Elasticsearch failed: {"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Field [refunds.transactions.receipt.\_keyed] of type [flattened] does not support custom formats"}],"type":"search\_phase\_execution\_exception","reason":"all shards failed","phase":"query","grouped":true,"failed\_shards":[{"shard":0,"index":"orders","node":"WABj1O30RYGHNg9qorNKIA","reason":{"type":"illegal\_argument\_exception","reason":"Field [refunds.transactions.receipt.\_keyed] of type [flattened] does not support custom formats"}}],"caused\_by":{"type":"illegal\_argument\_exception","reason":"Field [refunds.transactions.receipt.\_keyed] of type [flattened] does not support custom formats","caused\_by":{"type":"illegal\_argument\_exception","reason":"Field [refunds.transactions.receipt.\_keyed] of type [flattened] does not support custom formats"}}},"status":400}

I tried other types of visualization and it is launched always I'm trying to use the index with the flattened type.

I should highlight that **I'm never using the flattened field** for any visualization or aggregation. I attached one image showing the error and how I try to create the visualization.

Can anyone tell me why the index become useless when 1 field is set to "flattened"?

Thanks in advance!!

[error\_kibana|690x401](https://discuss.elastic.co/uploads/short-url/rAH0lN4aIyRI1AoPGxkNYu03ca6.png)

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [August 12, 2019, 11:21pm UTC](https://discuss.elastic.co/t/problem-in-visualizations-after-using-flattened-datatype/194584/2 "2019-08-12T23:21:40Z")

</div>

@timroes needs to shed some light here .

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [August 13, 2019, 10:08am UTC](https://discuss.elastic.co/t/problem-in-visualizations-after-using-flattened-datatype/194584/3 "2019-08-13T10:08:03Z")

</div>

Hi Julio,

I am unfortunately unable to reproduce this. Could you please give the following two additional information:

If you go to "Inspect" (in the top menu) and then select Request (instead of Data) from the top right, could you please post the request that was made towards Elasticsearch here.

Also could you go to Management \> Index Patterns and open the index pattern for that index on the page that has the order.transactions.receipt field and post a screenshot of that field?

Thanks a lot,  
Tim

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 10, 2019, 10:08am UTC](https://discuss.elastic.co/t/problem-in-visualizations-after-using-flattened-datatype/194584/4 "2019-09-10T10:08:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
