Is it possible to integrate SQL query into ElasticSearch Java API

(Barun Kumar) #1

I have to search some data using JAVA API. I can do the same using X_PACK Sql query. Same needs to be done through JAVA API. I have searched a lot but didn't find the reult.
My Sql Query is like:
select map.serviceName as name, count(map.serviceName) as noOfTimesApiUsed, avg(map.executionTimeInSeconds) as averageTime from auditlogs where map.orgId = 'XXXXX' group by map.serviceName order by noOfTimesApiUsed desc

Please help to change the query in JAVA code.

(Andrei Stefan) #2

Hi @Barun_Kumar,
There is the option of the Elasticsearch JDBC driver that you can find more info about here.

(Barun Kumar) #3

this is somehow license related and can be done in Platinum licensed version only. Is it?

(David Pilato) #4

Correct. You need to activate the trial or enter a platinum license number. You can activate a free trial of the commercial features via Kibana (Management -> License) or via the API.

See Subscriptions about the different features available.