Define timeout for a "count"
See original GitHub issueIt seems like it is possible to pass a timeout
argument to a search:
es.search(
index=my_index,
doc_type='actions',
timeout = '900',
body=
{
"size": 0,
"query": {
"constant_score": {
"filter": {
"terms": {
"ID": IDs
}
},
"boost": 1.2
}
}
})
It is then possible to count the number of documents by looking at the ['hits']['total']
. A more direct approach would be to use the Elasticsearch.count
. However, when doing so it is not possible to pass a timeout
argument. A workaround is to use a search
with the search_type
set to count
.
Doesn’t it make sense to have also for the count
the possibility to set a timeout
?
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Counter in set Timeout nested in set interval is summed ...
My intent is to have the counter updated once every time the set timeout function is called. But it seems that the callback...
Read more >Count() method giving error Timeout expired - MSDN
Count() method giving error Timeout expired - The timeout period elapsed prior to completion of the operation or the server is not responding....
Read more >Time-out (sport) - Wikipedia
In sports, a time-out or timeout is a halt in the play. This allows the coaches of either team to communicate with the...
Read more >setTimeout() - Web APIs - MDN Web Docs
The global setTimeout() method sets a timer which executes a function or specified piece of code once the timer expires.
Read more >Setting Timeout and Retry Count correctly for HTTP import ...
When calling a service with a HTTP import binding, how do I set timeout and retry values according to my needs ?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
global parameter
timeout
sets the timeout on the socket, per-request parameterrequest_timeout
does the same. The reason it’s named differently is because in some cases the APIs already have a parameter namedtimeout
that does something else (internal timeout within elasticsearch).I tried to document this in the docs: http://elasticsearch-py.readthedocs.org/en/master/api.html#timeout
please let me know if that’s confusing or what could be clearer there, thanks!
The default is 10 seconds for the global timeout (mentioned in [0]) and if request_timeout is not specified the global timeout will be used.
Yes, the search API is an example of an API that allows for the timeout parameter that will just be passed to elasticsearch.
0 - http://elasticsearch-py.readthedocs.org/en/master/connection.html#connection