# Facets / OurOfMemorryError / Required RAM

**URL:** <https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889>\
**Category:** Elasticsearch\
**Created:** [November 16, 2011, 5:06pm UTC](https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889 "2011-11-16T17:06:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loco\_Jay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loco_jay/32/2982_2.png) [@Loco\_Jay](https://discuss.elastic.co/u/Loco_Jay)\
**Post date:** [November 16, 2011, 5:06pm UTC](https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889/1 "2011-11-16T17:06:29Z")

</div>

Hi,

I m running into OutOfMemoryError on a facet query.

Running es @ 14g :

```
elasticsearch -f Xmx14g -Xms14g -XX-:HeapDumpOnOutOfMemorryError

```

Its seems that facets always load the full index of a field into memory. Distributing by splitting the query in smaller chunk (from , size) would not work.

I hoped that changing my field to a multifield and using another tokenizer which strips out numbers... would make this work but  
unfortunately it failed.

I guess my only chance is to buy more RAM. but how much ? How can i check how much Memory would be required for a successful call

bellow is the output of the stats api

{  
"cluster\_name" : "elasticsearch",  
"nodes" : {  
"LCHFG\_l2Qjysf\_fGKFrlgA" : {  
"name" : "Puma",  
"indices" : {  
"store" : {  
"size" : "79.6gb",  
"size\_in\_bytes" : 85495982520  
},  
"docs" : {  
"count" : 1528884,  
"deleted" : 108  
},  
"indexing" : {  
"index\_total" : 0,  
"index\_time" : "0s",  
"index\_time\_in\_millis" : 0,  
"delete\_total" : 0,  
"delete\_time" : "0s",  
"delete\_time\_in\_millis" : 0  
},  
"get" : {  
"total" : 0,  
"time" : "0s",  
"time\_in\_millis" : 0,  
"exists\_total" : 0,  
"exists\_time" : "0s",  
"exists\_time\_in\_millis" : 0,  
"missing\_total" : 0,  
"missing\_time" : "0s",  
"missing\_time\_in\_millis" : 0  
},  
"search" : {  
"query\_total" : 40,  
"query\_time" : "2s",  
"query\_time\_in\_millis" : 2008,  
"fetch\_total" : 8,  
"fetch\_time" : "35ms",  
"fetch\_time\_in\_millis" : 35  
},  
"cache" : {  
"field\_evictions" : 0,  
"field\_size" : "5.8gb",  
"field\_size\_in\_bytes" : 6323033016,  
"filter\_count" : 0,  
"filter\_evictions" : 0,  
"filter\_size" : "0b",  
"filter\_size\_in\_bytes" : 0  
},  
"merges" : {  
"current" : 0,  
"current\_docs" : 0,  
"current\_size" : "0b",  
"current\_size\_in\_bytes" : 0,  
"total" : 0,  
"total\_time" : "0s",  
"total\_time\_in\_millis" : 0,  
"total\_docs" : 0,  
"total\_size" : "0b",  
"total\_size\_in\_bytes" : 0  
},  
"refresh" : {  
"total" : 10,  
"total\_time" : "0s",  
"total\_time\_in\_millis" : 0  
},  
"flush" : {  
"total" : 0,  
"total\_time" : "0s",  
"total\_time\_in\_millis" : 0  
}  
},  
"os" : {  
"timestamp" : 1321461279333,  
"uptime" : "23 minutes and 34 seconds",  
"uptime\_in\_millis" : 1414000,  
"load\_average" : [1.57470703125, 1.248046875, 0.896484375],  
"cpu" : {  
"sys" : 1,  
"user" : 5,  
"idle" : 93  
},  
"mem" : {  
"free" : "571.1mb",  
"free\_in\_bytes" : 598867968,  
"used" : "15.4gb",  
"used\_in\_bytes" : 16581001216,  
"free\_percent" : 31,  
"used\_percent" : 68,  
"actual\_free" : "5gb",  
"actual\_free\_in\_bytes" : 5403758592,  
"actual\_used" : "10.9gb",  
"actual\_used\_in\_bytes" : 11776110592  
},  
"swap" : {  
"used" : "28mb",  
"used\_in\_bytes" : 29368320,  
"free" : "227.9mb",  
"free\_in\_bytes" : 239067136  
}  
},  
"process" : {  
"timestamp" : 1321461279333,  
"open\_file\_descriptors" : 1826,  
"cpu" : {  
"percent" : 85,  
"sys" : "46 seconds and 91 milliseconds",  
"sys\_in\_millis" : 46091,  
"user" : "4 minutes, 12 seconds and 994 milliseconds",  
"user\_in\_millis" : 252994,  
"total" : "4 minutes, 59 seconds and 85 milliseconds",  
"total\_in\_millis" : 299085  
},  
"mem" : {  
"resident" : "12.3gb",  
"resident\_in\_bytes" : 13241835520,  
"share" : "-1b",  
"share\_in\_bytes" : -1,  
"total\_virtual" : "14.9gb",  
"total\_virtual\_in\_bytes" : 16070979584  
}  
},  
"jvm" : {  
"timestamp" : 1321461279333,  
"uptime" : "5 minutes, 47 seconds and 605 milliseconds",  
"uptime\_in\_millis" : 347605,  
"mem" : {  
"heap\_used" : "6gb",  
"heap\_used\_in\_bytes" : 6534761792,  
"heap\_committed" : "11.9gb",  
"heap\_committed\_in\_bytes" : 12856590336,  
"non\_heap\_used" : "31.4mb",  
"non\_heap\_used\_in\_bytes" : 33028544,  
"non\_heap\_committed" : "52.9mb",  
"non\_heap\_committed\_in\_bytes" : 55484416  
},  
"threads" : {  
"count" : 37,  
"peak\_count" : 42  
},  
"gc" : {  
"collection\_count" : 139,  
"collection\_time" : "14 seconds and 275 milliseconds",  
"collection\_time\_in\_millis" : 14275,  
"collectors" : {  
"ParNew" : {  
"collection\_count" : 97,  
"collection\_time" : "13 seconds and 383 milliseconds",  
"collection\_time\_in\_millis" : 13383  
},  
"ConcurrentMarkSweep" : {  
"collection\_count" : 42,  
"collection\_time" : "892 milliseconds",  
"collection\_time\_in\_millis" : 892  
}  
}  
}  
},  
"network" : {  
"tcp" : {  
"active\_opens" : 306,  
"passive\_opens" : 55,  
"curr\_estab" : 67,  
"in\_segs" : 54832,  
"out\_segs" : 52636,  
"retrans\_segs" : 0,  
"estab\_resets" : 4,  
"attempt\_fails" : 106,  
"in\_errs" : 1,  
"out\_rsts" : -1  
}  
},  
"transport" : {  
"server\_open" : 7,  
"rx\_count" : 0,  
"rx\_size" : "0b",  
"rx\_size\_in\_bytes" : 0,  
"tx\_count" : 0,  
"tx\_size" : "0b",  
"tx\_size\_in\_bytes" : 0  
},  
"http" : {  
"server\_open" : 4  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 17, 2011, 12:57pm UTC](https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889/2 "2011-11-17T12:57:37Z")

</div>

Yes, faceting will require loading all the field values to memory (as does  
sorting). Hard to tell how much memory you will need, since it depends on  
how many values and how big they are for that field.

On Wed, Nov 16, 2011 at 7:06 PM, LocoJay Dev [locojaydev@gmail.com](mailto:locojaydev@gmail.com) wrote:

> Hi,
> 
> I m running into OutOfMemoryError on a facet query.
> 
> Running es @ 14g :
> 
> ```
> elasticsearch -f Xmx14g -Xms14g -XX-:HeapDumpOnOutOfMemorryError
> 
> ```
> 
> Its seems that facets always load the full index of a field into memory.  
> Distributing by splitting the query in smaller chunk (from , size) would  
> not work.
> 
> I hoped that changing my field to a multifield and using another tokenizer  
> which strips out numbers... would make this work but  
> unfortunately it failed.
> 
> I guess my only chance is to buy more RAM. but how much ? How can i check  
> how much Memory would be required for a successful call
> 
> bellow is the output of the stats api
> 
> {  
> "cluster\_name" : "elasticsearch",  
> "nodes" : {  
> "LCHFG\_l2Qjysf\_fGKFrlgA" : {  
> "name" : "Puma",  
> "indices" : {  
> "store" : {  
> "size" : "79.6gb",  
> "size\_in\_bytes" : 85495982520  
> },  
> "docs" : {  
> "count" : 1528884,  
> "deleted" : 108  
> },  
> "indexing" : {  
> "index\_total" : 0,  
> "index\_time" : "0s",  
> "index\_time\_in\_millis" : 0,  
> "delete\_total" : 0,  
> "delete\_time" : "0s",  
> "delete\_time\_in\_millis" : 0  
> },  
> "get" : {  
> "total" : 0,  
> "time" : "0s",  
> "time\_in\_millis" : 0,  
> "exists\_total" : 0,  
> "exists\_time" : "0s",  
> "exists\_time\_in\_millis" : 0,  
> "missing\_total" : 0,  
> "missing\_time" : "0s",  
> "missing\_time\_in\_millis" : 0  
> },  
> "search" : {  
> "query\_total" : 40,  
> "query\_time" : "2s",  
> "query\_time\_in\_millis" : 2008,  
> "fetch\_total" : 8,  
> "fetch\_time" : "35ms",  
> "fetch\_time\_in\_millis" : 35  
> },  
> "cache" : {  
> "field\_evictions" : 0,  
> "field\_size" : "5.8gb",  
> "field\_size\_in\_bytes" : 6323033016,  
> "filter\_count" : 0,  
> "filter\_evictions" : 0,  
> "filter\_size" : "0b",  
> "filter\_size\_in\_bytes" : 0  
> },  
> "merges" : {  
> "current" : 0,  
> "current\_docs" : 0,  
> "current\_size" : "0b",  
> "current\_size\_in\_bytes" : 0,  
> "total" : 0,  
> "total\_time" : "0s",  
> "total\_time\_in\_millis" : 0,  
> "total\_docs" : 0,  
> "total\_size" : "0b",  
> "total\_size\_in\_bytes" : 0  
> },  
> "refresh" : {  
> "total" : 10,  
> "total\_time" : "0s",  
> "total\_time\_in\_millis" : 0  
> },  
> "flush" : {  
> "total" : 0,  
> "total\_time" : "0s",  
> "total\_time\_in\_millis" : 0  
> }  
> },  
> "os" : {  
> "timestamp" : 1321461279333,  
> "uptime" : "23 minutes and 34 seconds",  
> "uptime\_in\_millis" : 1414000,  
> "load\_average" : [1.57470703125, 1.248046875, 0.896484375],  
> "cpu" : {  
> "sys" : 1,  
> "user" : 5,  
> "idle" : 93  
> },  
> "mem" : {  
> "free" : "571.1mb",  
> "free\_in\_bytes" : 598867968,  
> "used" : "15.4gb",  
> "used\_in\_bytes" : 16581001216,  
> "free\_percent" : 31,  
> "used\_percent" : 68,  
> "actual\_free" : "5gb",  
> "actual\_free\_in\_bytes" : 5403758592,  
> "actual\_used" : "10.9gb",  
> "actual\_used\_in\_bytes" : 11776110592  
> },  
> "swap" : {  
> "used" : "28mb",  
> "used\_in\_bytes" : 29368320,  
> "free" : "227.9mb",  
> "free\_in\_bytes" : 239067136  
> }  
> },  
> "process" : {  
> "timestamp" : 1321461279333,  
> "open\_file\_descriptors" : 1826,  
> "cpu" : {  
> "percent" : 85,  
> "sys" : "46 seconds and 91 milliseconds",  
> "sys\_in\_millis" : 46091,  
> "user" : "4 minutes, 12 seconds and 994 milliseconds",  
> "user\_in\_millis" : 252994,  
> "total" : "4 minutes, 59 seconds and 85 milliseconds",  
> "total\_in\_millis" : 299085  
> },  
> "mem" : {  
> "resident" : "12.3gb",  
> "resident\_in\_bytes" : 13241835520,  
> "share" : "-1b",  
> "share\_in\_bytes" : -1,  
> "total\_virtual" : "14.9gb",  
> "total\_virtual\_in\_bytes" : 16070979584  
> }  
> },  
> "jvm" : {  
> "timestamp" : 1321461279333,  
> "uptime" : "5 minutes, 47 seconds and 605 milliseconds",  
> "uptime\_in\_millis" : 347605,  
> "mem" : {  
> "heap\_used" : "6gb",  
> "heap\_used\_in\_bytes" : 6534761792,  
> "heap\_committed" : "11.9gb",  
> "heap\_committed\_in\_bytes" : 12856590336,  
> "non\_heap\_used" : "31.4mb",  
> "non\_heap\_used\_in\_bytes" : 33028544,  
> "non\_heap\_committed" : "52.9mb",  
> "non\_heap\_committed\_in\_bytes" : 55484416  
> },  
> "threads" : {  
> "count" : 37,  
> "peak\_count" : 42  
> },  
> "gc" : {  
> "collection\_count" : 139,  
> "collection\_time" : "14 seconds and 275 milliseconds",  
> "collection\_time\_in\_millis" : 14275,  
> "collectors" : {  
> "ParNew" : {  
> "collection\_count" : 97,  
> "collection\_time" : "13 seconds and 383 milliseconds",  
> "collection\_time\_in\_millis" : 13383  
> },  
> "ConcurrentMarkSweep" : {  
> "collection\_count" : 42,  
> "collection\_time" : "892 milliseconds",  
> "collection\_time\_in\_millis" : 892  
> }  
> }  
> }  
> },  
> "network" : {  
> "tcp" : {  
> "active\_opens" : 306,  
> "passive\_opens" : 55,  
> "curr\_estab" : 67,  
> "in\_segs" : 54832,  
> "out\_segs" : 52636,  
> "retrans\_segs" : 0,  
> "estab\_resets" : 4,  
> "attempt\_fails" : 106,  
> "in\_errs" : 1,  
> "out\_rsts" : -1  
> }  
> },  
> "transport" : {  
> "server\_open" : 7,  
> "rx\_count" : 0,  
> "rx\_size" : "0b",  
> "rx\_size\_in\_bytes" : 0,  
> "tx\_count" : 0,  
> "tx\_size" : "0b",  
> "tx\_size\_in\_bytes" : 0  
> },  
> "http" : {  
> "server\_open" : 4  
> }  
> }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [November 17, 2011, 8:49pm UTC](https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889/3 "2011-11-17T20:49:15Z")

</div>

On Nov 17, 1:57 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Yes, faceting will require loading all the field values to memory (as does  
> sorting). Hard to tell how much memory you will need, since it depends on  
> how many values and how big they are for that field.

But couldn't it be reduced when using a filter for (query+)facet?

> I hoped that changing my field to a multifield and using another tokenizer which strips out numbers... would make this work but unfortunately it failed.

what failed? did you reindex?

Regards,  
Peter.

---

<div class="post-metadata">

**Author:** ![Loco\_Jay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loco_jay/32/2982_2.png) [@Loco\_Jay](https://discuss.elastic.co/u/Loco_Jay)\
**Post date:** [November 17, 2011, 9:29pm UTC](https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889/4 "2011-11-17T21:29:19Z")

</div>

Thanks.

I upgraded my node to run es @ 30g but unfortunately this did not help.  
Just to make sure if i define the following for a filed:

```
    "fulltext": {
        "type": "multi_field",
        "fields":{
            "fulltext":{
                "index": "analyzed",
                "store": "yes",
                "term_vector": "with_positions_offsets",
                "type": "string"
            },
            "cleaned":{
                "index": "analyzed",
                "analyzer":"cleaned",
                "store": "yes",
                "term_vector": "with_positions_offsets",
                "type": "string"

            }
        }
    },

```

will only fulltext.cleaned be loaded into memory or both fulltext and fulltext.cleaned.  
Are there any plans to go to disk or give the ability to do facets on a subseach? I really just need a term:count and luke is not an option.

thanks for helping out.

On Nov 17, 2011, at 7:57 AM, Shay Banon wrote:

> Yes, faceting will require loading all the field values to memory (as does sorting). Hard to tell how much memory you will need, since it depends on how many values and how big they are for that field.
> 
> On Wed, Nov 16, 2011 at 7:06 PM, LocoJay Dev [locojaydev@gmail.com](mailto:locojaydev@gmail.com) wrote:
> 
> Hi,
> 
> I m running into OutOfMemoryError on a facet query.
> 
> Running es @ 14g :
> 
> ```
> elasticsearch -f Xmx14g -Xms14g -XX-:HeapDumpOnOutOfMemorryError
> 
> ```
> 
> Its seems that facets always load the full index of a field into memory. Distributing by splitting the query in smaller chunk (from , size) would not work.
> 
> I hoped that changing my field to a multifield and using another tokenizer which strips out numbers... would make this work but  
> unfortunately it failed.
> 
> I guess my only chance is to buy more RAM. but how much ? How can i check how much Memory would be required for a successful call
> 
> bellow is the output of the stats api
> 
> {  
> "cluster\_name" : "elasticsearch",  
> "nodes" : {  
> "LCHFG\_l2Qjysf\_fGKFrlgA" : {  
> "name" : "Puma",  
> "indices" : {  
> "store" : {  
> "size" : "79.6gb",  
> "size\_in\_bytes" : 85495982520  
> },  
> "docs" : {  
> "count" : 1528884,  
> "deleted" : 108  
> },  
> "indexing" : {  
> "index\_total" : 0,  
> "index\_time" : "0s",  
> "index\_time\_in\_millis" : 0,  
> "delete\_total" : 0,  
> "delete\_time" : "0s",  
> "delete\_time\_in\_millis" : 0  
> },  
> "get" : {  
> "total" : 0,  
> "time" : "0s",  
> "time\_in\_millis" : 0,  
> "exists\_total" : 0,  
> "exists\_time" : "0s",  
> "exists\_time\_in\_millis" : 0,  
> "missing\_total" : 0,  
> "missing\_time" : "0s",  
> "missing\_time\_in\_millis" : 0  
> },  
> "search" : {  
> "query\_total" : 40,  
> "query\_time" : "2s",  
> "query\_time\_in\_millis" : 2008,  
> "fetch\_total" : 8,  
> "fetch\_time" : "35ms",  
> "fetch\_time\_in\_millis" : 35  
> },  
> "cache" : {  
> "field\_evictions" : 0,  
> "field\_size" : "5.8gb",  
> "field\_size\_in\_bytes" : 6323033016,  
> "filter\_count" : 0,  
> "filter\_evictions" : 0,  
> "filter\_size" : "0b",  
> "filter\_size\_in\_bytes" : 0  
> },  
> "merges" : {  
> "current" : 0,  
> "current\_docs" : 0,  
> "current\_size" : "0b",  
> "current\_size\_in\_bytes" : 0,  
> "total" : 0,  
> "total\_time" : "0s",  
> "total\_time\_in\_millis" : 0,  
> "total\_docs" : 0,  
> "total\_size" : "0b",  
> "total\_size\_in\_bytes" : 0  
> },  
> "refresh" : {  
> "total" : 10,  
> "total\_time" : "0s",  
> "total\_time\_in\_millis" : 0  
> },  
> "flush" : {  
> "total" : 0,  
> "total\_time" : "0s",  
> "total\_time\_in\_millis" : 0  
> }  
> },  
> "os" : {  
> "timestamp" : 1321461279333,  
> "uptime" : "23 minutes and 34 seconds",  
> "uptime\_in\_millis" : 1414000,  
> "load\_average" : [1.57470703125, 1.248046875, 0.896484375],  
> "cpu" : {  
> "sys" : 1,  
> "user" : 5,  
> "idle" : 93  
> },  
> "mem" : {  
> "free" : "571.1mb",  
> "free\_in\_bytes" : 598867968,  
> "used" : "15.4gb",  
> "used\_in\_bytes" : 16581001216,  
> "free\_percent" : 31,  
> "used\_percent" : 68,  
> "actual\_free" : "5gb",  
> "actual\_free\_in\_bytes" : 5403758592,  
> "actual\_used" : "10.9gb",  
> "actual\_used\_in\_bytes" : 11776110592  
> },  
> "swap" : {  
> "used" : "28mb",  
> "used\_in\_bytes" : 29368320,  
> "free" : "227.9mb",  
> "free\_in\_bytes" : 239067136  
> }  
> },  
> "process" : {  
> "timestamp" : 1321461279333,  
> "open\_file\_descriptors" : 1826,  
> "cpu" : {  
> "percent" : 85,  
> "sys" : "46 seconds and 91 milliseconds",  
> "sys\_in\_millis" : 46091,  
> "user" : "4 minutes, 12 seconds and 994 milliseconds",  
> "user\_in\_millis" : 252994,  
> "total" : "4 minutes, 59 seconds and 85 milliseconds",  
> "total\_in\_millis" : 299085  
> },  
> "mem" : {  
> "resident" : "12.3gb",  
> "resident\_in\_bytes" : 13241835520,  
> "share" : "-1b",  
> "share\_in\_bytes" : -1,  
> "total\_virtual" : "14.9gb",  
> "total\_virtual\_in\_bytes" : 16070979584  
> }  
> },  
> "jvm" : {  
> "timestamp" : 1321461279333,  
> "uptime" : "5 minutes, 47 seconds and 605 milliseconds",  
> "uptime\_in\_millis" : 347605,  
> "mem" : {  
> "heap\_used" : "6gb",  
> "heap\_used\_in\_bytes" : 6534761792,  
> "heap\_committed" : "11.9gb",  
> "heap\_committed\_in\_bytes" : 12856590336,  
> "non\_heap\_used" : "31.4mb",  
> "non\_heap\_used\_in\_bytes" : 33028544,  
> "non\_heap\_committed" : "52.9mb",  
> "non\_heap\_committed\_in\_bytes" : 55484416  
> },  
> "threads" : {  
> "count" : 37,  
> "peak\_count" : 42  
> },  
> "gc" : {  
> "collection\_count" : 139,  
> "collection\_time" : "14 seconds and 275 milliseconds",  
> "collection\_time\_in\_millis" : 14275,  
> "collectors" : {  
> "ParNew" : {  
> "collection\_count" : 97,  
> "collection\_time" : "13 seconds and 383 milliseconds",  
> "collection\_time\_in\_millis" : 13383  
> },  
> "ConcurrentMarkSweep" : {  
> "collection\_count" : 42,  
> "collection\_time" : "892 milliseconds",  
> "collection\_time\_in\_millis" : 892  
> }  
> }  
> }  
> },  
> "network" : {  
> "tcp" : {  
> "active\_opens" : 306,  
> "passive\_opens" : 55,  
> "curr\_estab" : 67,  
> "in\_segs" : 54832,  
> "out\_segs" : 52636,  
> "retrans\_segs" : 0,  
> "estab\_resets" : 4,  
> "attempt\_fails" : 106,  
> "in\_errs" : 1,  
> "out\_rsts" : -1  
> }  
> },  
> "transport" : {  
> "server\_open" : 7,  
> "rx\_count" : 0,  
> "rx\_size" : "0b",  
> "rx\_size\_in\_bytes" : 0,  
> "tx\_count" : 0,  
> "tx\_size" : "0b",  
> "tx\_size\_in\_bytes" : 0  
> },  
> "http" : {  
> "server\_open" : 4  
> }  
> }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![Loco\_Jay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loco_jay/32/2982_2.png) [@Loco\_Jay](https://discuss.elastic.co/u/Loco_Jay)\
**Post date:** [November 17, 2011, 10:12pm UTC](https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889/5 "2011-11-17T22:12:45Z")

</div>

On Nov 17, 2011, at 3:49 PM, Karussell wrote:

> On Nov 17, 1:57 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > Yes, faceting will require loading all the field values to memory (as does  
> > sorting). Hard to tell how much memory you will need, since it depends on  
> > how many values and how big they are for that field.
> 
> But couldn't it be reduced when using a filter for (query+)facet?

This is what i m looking for. Its seems that this is not possible

> > I hoped that changing my field to a multifield and using another tokenizer which strips out numbers... would make this work but unfortunately it failed.
> 
> what failed? did you reindex?

I reindexed based on a different tokenizer producing a smaller amount of words but this still failed with a OutofMemoryError after upgrading my node to run es @30g.

```
   "fulltext": {
        "type": "multi_field",
        "fields":{
            "fulltext":{
                "index": "analyzed",
                "store": "yes",
                "term_vector": "with_positions_offsets",
                "type": "string"
            },
            "cleaned":{
                "index": "analyzed",
                "analyzer":"cleaned",
                "store": "yes",
                "term_vector": "with_positions_offsets",
                "type": "string"

            }
        }
    },

```

where cleaned :

```
    "settings":{
        "analysis":
        {
            "analyzer":
            {
                "cleaned":
                {
                    "type":"custom",
                    "filter":["lowercase", "stop"],
                    "tokenizer":"letter"
                }
            }
        }
    }

```

> Regards,  
> Peter.

---

<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 6, 2017, 3:48am UTC](https://discuss.elastic.co/t/facets-ourofmemorryerror-required-ram/5889/6 "2017-07-06T03:48:16Z")

</div>


