# FIELDDATA Data is too large

**URL:** <https://discuss.elastic.co/t/fielddata-data-is-too-large/54104>\
**Category:** Elasticsearch\
**Created:** [June 28, 2016, 5:12am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104 "2016-06-28T05:12:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Radoslaw\_Wojtkiewicz](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@Radoslaw\_Wojtkiewicz](https://discuss.elastic.co/u/Radoslaw_Wojtkiewicz)\
**Post date:** [June 28, 2016, 5:12am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/1 "2016-06-28T05:12:12Z")

</div>

I have a problem with sorting namely, sorting work but only for price field. When I try to sort by start\_date, end\_date, uid, cat title get the message about exceeding the limit:

`Data too large, the date for ["name of field here"] would be larger than the limit of [19798897459 / 18.4gb]]`

I do not know why this is happening code looks correct sample query for elastica looks like this:

Mapping:

```
"auctions": {
                "_all": { "enabled": false }, 
                "properties": {
                    "cat": { "store": true, "type": "long" }, 
                    "curr": { "index": "not_analyzed", "store": true, "type": "string" }, 
                    "end_date": { "store": true, "type": "long" }, 
                    "price": { "store": true, "type": "long" }, 
                    "start_date": { "store": true, "type": "long" }, 
                    "tcat": { "store": true, "type": "long" }, 
                    "title": { "store": true, "type": "string" }, 
                    "uid": { "store": true, "type": "long" }
                }
            }, 

```

/\_stats/fielddata?fields=\*

```
{
    "_shards": {
        "total": 10,
        "successful": 5,
        "failed": 0
    },
    "_all": {
        "primaries": {
            "fielddata": {
                "memory_size_in_bytes": 19466671904,
                "evictions": 0,
                "fields": {
                    "_id": {
                        "memory_size_in_bytes": 0
                    },
                    "cat": {
                        "memory_size_in_bytes": 0
                    },
                    "price": {
                        "memory_size_in_bytes": 3235221240
                    },
                    "title": {
                        "memory_size_in_bytes": 16231450664
                    }
                }
            }
        },
        "total": {
            "fielddata": {
                "memory_size_in_bytes": 19466671904,
                "evictions": 0,
                "fields": {
                    "_id": {
                        "memory_size_in_bytes": 0
                    },
                    "cat": {
                        "memory_size_in_bytes": 0
                    },
                    "price": {
                        "memory_size_in_bytes": 3235221240
                    },
                    "title": {
                        "memory_size_in_bytes": 16231450664
                    }
                }
            }
        }
    },
    "indices": {
        "allek": {
            "primaries": {
                "fielddata": {
                    "memory_size_in_bytes": 19466671904,
                    "evictions": 0,
                    "fields": {
                        "_id": {
                            "memory_size_in_bytes": 0
                        },
                        "cat": {
                            "memory_size_in_bytes": 0
                        },
                        "price": {
                            "memory_size_in_bytes": 3235221240
                        },
                        "title": {
                            "memory_size_in_bytes": 16231450664
                        }
                    }
                }
            },
            "total": {
                "fielddata": {
                    "memory_size_in_bytes": 19466671904,
                    "evictions": 0,
                    "fields": {
                        "_id": {
                            "memory_size_in_bytes": 0
                        },
                        "cat": {
                            "memory_size_in_bytes": 0
                        },
                        "price": {
                            "memory_size_in_bytes": 3235221240
                        },
                        "title": {
                            "memory_size_in_bytes": 16231450664
                        }
                    }
                }
            }
        }
    }
}

```

Any ideas what might cause this exception?

I should add that I've tried these solutions:

[FIELDDATA Data is too large](http://stackoverflow.com/questions/30811046/fielddata-data-is-too-large)

But the effect was even worse, then no query did not work as quickly.

For any help I will be extremely grateful!

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [July 5, 2016, 8:52am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/2 "2016-07-05T08:52:31Z")

</div>

Hi @Radoslaw_Wojtkiewicz,

which Elasticsearch version do you use?

Daniel

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Wojtkiewicz](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@Radoslaw\_Wojtkiewicz](https://discuss.elastic.co/u/Radoslaw_Wojtkiewicz)\
**Post date:** [July 5, 2016, 9:09am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/3 "2016-07-05T09:09:17Z")

</div>

```
{
  "status" : 200,
  "name" : "Quicksand",
  "cluster_name" : "allek",
  "version" : {
    "number" : "1.7.5",
    "build_hash" : "00f95f4ffca6de89d68b7ccaf80d148f1f70e4d4",
    "build_timestamp" : "2016-02-02T09:55:30Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}
```

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [July 5, 2016, 9:21am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/4 "2016-07-05T09:21:23Z")

</div>

Hi @Radoslaw_Wojtkiewicz,

you could enable [doc\_values](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/fielddata-formats.html#_string_field_data_types) to avoid using field data for sorting. But be aware of the restrictions stated in the docs:

> Lowers memory usage but only works on non-analyzed strings (index: no or not\_analyzed).

So you could use a second field (e.g. title\_sort) which is `not_analyzed` and sort on that instead of the actual title field.

Daniel

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Wojtkiewicz](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@Radoslaw\_Wojtkiewicz](https://discuss.elastic.co/u/Radoslaw_Wojtkiewicz)\
**Post date:** [July 5, 2016, 9:23am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/5 "2016-07-05T09:23:59Z")

</div>

Thanks for your answer !

So my map should be look like this now?

auctions:

```
{
  "_all": {
    "enabled": false
  },
  "properties": {
    "cat": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "curr": {
      "index": "not_analyzed",
      "store": true,
      "type": "string",
      "doc_values": true
    },
    "end_date": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "price": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "start_date": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "tcat": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "title": {
      "store": true,
      "type": "string",
      "fields": {
        "raw": {
          "type": "string",
          "index": "not_analyzed",
          "ignore_above": 256,
          "doc_values": true
        }
      }
    },
    "uid": {
      "store": true,
      "type": "long",
      "doc_values": true
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [July 5, 2016, 10:30am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/6 "2016-07-05T10:30:44Z")

</div>

Yes, that looks about right. Don't forget that you need to reindex your data after you've changed the mapping.

Daniel

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Wojtkiewicz](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@Radoslaw\_Wojtkiewicz](https://discuss.elastic.co/u/Radoslaw_Wojtkiewicz)\
**Post date:** [July 5, 2016, 10:43am UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/7 "2016-07-05T10:43:43Z")

</div>

Okey thanks !

---

<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:** [July 5, 2017, 10:38pm UTC](https://discuss.elastic.co/t/fielddata-data-is-too-large/54104/8 "2017-07-05T22:38:03Z")

</div>


