Setting up or controlling multithreaded search

(Gary Smithrud) #1

Is it possible to set up a multithreaded search where I have control over the threads and am able to stop the search and free up resources? I'm thinking of splitting the search up into components, using threads to handle the components, and if it takes too long, kill the threads and free the search resources on the server. I know that I can use Java threads to do part of this, but there does not appear to be a way to free up the search resources. I also noticed that BulkRequest has a waitFor method (or something similar to that), but BulkRequest can't be used with a SearchRequest. I am new to Elastic Search, so if you have suggestions, I would appreciate it (or that it can't be done would help too).

(Adrien Grand) #2

There is no way to cancel running search requests right now. Your best option would be to set a timeout on your search requests.

(system) #3