# 504 Gateway Time-out

**URL:** https://discuss.elastic.co/t/504-gateway-time-out/10446
**Category:** Elasticsearch
**Created:** [January 22, 2013, 4:22am UTC](https://discuss.elastic.co/t/504-gateway-time-out/10446 "2013-01-22T04:22:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Curt\_Hu](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@Curt\_Hu](https://discuss.elastic.co/u/Curt_Hu)
#### Post date: [January 22, 2013, 4:22am UTC](https://discuss.elastic.co/t/504-gateway-time-out/10446/1 "2013-01-22T04:22:58Z")

</div>

I've run a query with terms facets.  
The main query will return only 13 hits:

but I've added a terms facets.  
"facets" : {  
"allterms" : {  
"terms" : {  
"field" : "strItemKeywords",  
"size" : 5  
}  
}  
}

When I use curl to run, I got:

504 Gateway Time-out
# 504 Gateway Time-out

* * *
nginx/1.0.5

the field strItemKeywords contain a lot of terms for each hit, (about 500 to 1000), if I change tge terms field to another, (may only have just 1 term), the above exception will never happen..

like:  
"facets" : {  
"allterms" : {  
"terms" : {  
"field" : "dTItemDateTime",  
"size" : 5  
}  
}  
}  
I will get :  
"facets" : {  
"allterms" : {  
"\_type" : "terms",  
"missing" : 0,  
"total" : 13,  
"other" : 1,  
"terms" : [ {  
"term" : 1340262765000,  
"count" : 2  
}, {  
"term" : 1340242261000,  
"count" : 2  
}, {  
"term" : 1340279836000,  
"count" : 1  
}, {  
"term" : 1340272114000,  
"count" : 1  
}, {  
"term" : 1340270016000,  
"count" : 1  
}, {  
"term" : 1340268728000,  
"count" : 1  
}, {  
"term" : 1340261653000,  
"count" : 1  
}, {  
"term" : 1340257709000,  
"count" : 1  
}, {  
"term" : 1340243107000,  
"count" : 1  
}, {  
"term" : 1340242851000,  
"count" : 1  
} ]  
}  
}  
...

So any suggestions for this?

---

<div class="post-metadata">

### Author: ![Curt\_Hu](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@Curt\_Hu](https://discuss.elastic.co/u/Curt_Hu)
#### Post date: [January 22, 2013, 1:46pm UTC](https://discuss.elastic.co/t/504-gateway-time-out/10446/2 "2013-01-22T13:46:04Z")

</div>

Just realize that strItemKeywords is not a single token, it is a big string separated with comma and spaces, so any idea if I want to get the top 10 terms for this field? Seemed that it's not possible to directly use terms facets.

---

<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, 2:55am UTC](https://discuss.elastic.co/t/504-gateway-time-out/10446/3 "2017-07-06T02:55:17Z")

</div>


