spring-data-elasticsearch icon indicating copy to clipboard operation
spring-data-elasticsearch copied to clipboard

spring-data-elasticsearch doesn't support elasticsearch sql

Open zzy444626905 opened this issue 2 years ago • 4 comments
trafficstars

elasticsearch sql like this:

select count(1) from "indexPrefix*"

zzy444626905 avatar Aug 31 '23 12:08 zzy444626905

That's right, would need to check if the Elasticsearch Java client supports this.

sothawo avatar Aug 31 '23 13:08 sothawo

ok, the Java client has a co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient, so support for this could be implemented.

sothawo avatar Sep 03 '23 19:09 sothawo

ok, the Java client has a co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient, so support for this could be implemented.

Thank big boss for supporting for this, make me stand on the shoulders of giants.

zzy444626905 avatar Sep 04 '23 02:09 zzy444626905

I had a deeper look today. Althoug integrating the query part is quite easy, it is way harder to find a good way to parse the response returned from an Elasticsearch SQL query into the entities that Spring Data Elasticsearch uses.

For the time being, I wrote a short post (https://www.sothawo.com/post/2023/11/14/use-elasticsearch-sql-with-spring-data-elasticsearch/) about this can currently be integrated int an application, but you need to do the response processing by yourself.

sothawo avatar Nov 14 '23 21:11 sothawo