pathway.io.elasticsearch.write(table, host, auth, index_name)
Write a table to a given index in ElasticSearch.
- table (
Table) – the table to output.
- host (
str) – the host and port, on which Elasticsearch server works.
- auth (
ElasticSearchAuth) – credentials for Elasticsearch authorization.
- index_name (
str) – name of the index, which gets the docs.
- table (
Consider there is an instance of Elasticsearch, running locally on a port 9200. There we have an index “animals”, containing an information about pets and their owners.
For the sake of simplicity we will also consider that the cluster has a simple username-password authentication having both username and password equal to “admin”.
Now suppose we want to send a Pathway table pets to this local instance of Elasticsearch.
It can be done as follows:
import pathway as pwt = pw.elasticsearch.write(
All the updates of table t will be indexed to “animals” as well.