Search timeout parameter not working


(José de Zárate) #1

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'
-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' -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!!! ;-(


(system) #2