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.
It does not exist in Elasticsearch yet.
However, you can have a look at this plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With