Asynchronous search using Java API?


(Hari Shankar) #1

Hi,

I am trying to implement pre-fetching of results from elasticsearch. For
this, it would be good if there was a way to search asynchronously. For
example, if I have get the first 100 results in the first query and I have
reached result # 80, then I can asynchronously fetch the next 100 hits so
that when I reach result # 100, the user doesn't have to wait before she can
view result # 101. How can I implement this?

Thanks,
Hari


(Karussell) #2

Normally queries are in the millisecond range. So intercepting them
shouldn't be necessary for a responsive UI. You can simple spawn a
thread or hold further results in 'cache' (e.g. fetching 20 records +
showing only 10).

On 13 Jul., 10:51, Hari Shankar shaan.h...@gmail.com wrote:

Hi,

I am trying to implement pre-fetching of results from elasticsearch. For
this, it would be good if there was a way to search asynchronously. For
example, if I have get the first 100 results in the first query and I have
reached result # 80, then I can asynchronously fetch the next 100 hits so
that when I reach result # 100, the user doesn't have to wait before she can
view result # 101. How can I implement this?

Thanks,
Hari


(system) #3