Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to stream documents from elastic search?

Is it possible to have a persistant HTTP connection to an elasticsearch where it simply outputs new documents when they are indexed?

For example, I'm adding a theoretical argument called stream:

curl -X GET 'http://localhost:9200/documents/_search?stream'

{"_index":"documents", "_type":"doc", "field": "value #1"}
{"_index":"documents", "_type":"doc", "field": "value #2"}
{"_index":"documents", "_type":"doc", "field": "value #3"}

... which would keep the connection running, presumably with HTTP chunked mode, until the client disconnects.

The alternative that I'm considering is to execute a GET request every second to the cluster with a time range of a second. I was hoping of a streaming mode to prevent the overhead.

There are elasticsearch Rivers, which seems to be the opposite to this.

like image 988
gak Avatar asked Apr 07 '13 23:04

gak


1 Answers

It does not exist in Elasticsearch yet.

However, you can have a look at this plugin.

like image 58
dadoonet Avatar answered Sep 21 '22 00:09

dadoonet