My colleagues put this tool together as part of a hackathon, and after cleaning it up our company has graciously allowed us to make it open source. Announcing "PostgreSQL foreign data wrapper for Elasticsearch" available at https://github.com/rtkwlf/esfdw. It's still in an early stage but it does work. Contributions are more than welcome.
What does it do? You can write SQL queries against PostgreSQL which will use Elasticsearch as the backend.
I won't copy the whole README here, but a few use cases:
- Writing SQL JOIN queries against Elasticsearch documents and letting the PostgreSQL engine do the heavy lifting
- Running window functions on data stored in Elasticsearch
- Applying PostgreSQL aggregations that do not currently have a native Elasticsearch equivalent