# Search timeout parameter not working

**URL:** <https://discuss.elastic.co/t/search-timeout-parameter-not-working/8442>\
**Category:** Elasticsearch\
**Created:** [July 17, 2012, 10:06pm UTC](https://discuss.elastic.co/t/search-timeout-parameter-not-working/8442 "2012-07-17T22:06:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon44344346](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@anon44344346](https://discuss.elastic.co/u/anon44344346)\
**Post date:** [July 17, 2012, 10:06pm UTC](https://discuss.elastic.co/t/search-timeout-parameter-not-working/8442/1 "2012-07-17T22:06:06Z")

</div>

Hi there

I must be doing something wrong, but I just can't find what. when doing:

curl -XGET '[http://localhost:9200/some\_index/\_search?timeout=40ms&pretty=1](http://localhost:9200/some_index/_search?timeout=40ms&pretty=1)'  
-d '  
{  
"query": {  
"fuzzy": {  
"\_all": "dostoyefsk"  
}  
}  
}'

I get:

{  
"took" : 861,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 1,  
"successful" : 1,  
"failed" : 0  
},

it says it took 861 ms, although I specified 10ms.

I tried with highlighting, also, which takes significantly more:

curl -XGET  
'[http://localhost:9200/some\_index/\_search?timeout=1000ms&pretty=1](http://localhost:9200/some_index/_search?timeout=1000ms&pretty=1)' -d '  
{  
"query": {  
"fuzzy": {  
"\_all": "dostoyefsk"  
}  
},  
"highlight": {  
"fields": { "body": {}, "answer": { }, "description": { } }  
}  
}'

and the answer  
{  
"took" : 5595,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 1,  
"successful" : 1,  
"failed" : 0  
},  
"hits" : {....

Ih this latter case, I asked for a 1 sec timeout, and obtained a 5.5  
seconds delay.

The only thing I can think of is that highlighting is not considered when  
calculating search timeouts , so the extra 4 seconds highlighting adds to  
the results comeback are not counted when calculating if the search is  
taking longer than specified timeout.

And also there is some kind of lower limit of the timeouts you can specify.  
Maybe specifying timeouts less than 500 ms is pointless, because that's  
less than the rough calculations ES would to to see if search is taking  
longer than timeout??

If somebody can shred some light, it would be deeply appreciated. everybody  
seems to be enjoying timeout parameter but me!!! ;-(

---

<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:20am UTC](https://discuss.elastic.co/t/search-timeout-parameter-not-working/8442/2 "2017-07-06T03:20:03Z")

</div>


