Installing jdbc driver for elasticsearch

i am following this document to install the driver but I do not have any maven tool . can I use wget to download the driver and then install it using elasticsearch plugin ?
if someone can kindly give me a detailed steps on how to install this driver.

https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-jdbc.html

Here you go: https://www.elastic.co/downloads/jdbc-client

As just a bit more of an FYI, you can find all of our product downloads at https://www.elastic.co/downloads

is this driver different from the SQL JDBC driver that is mentioned here?

https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-jdbc.html

It's basically the same thing. For the initial release, we had to bundle a few other jars from Elasticsearch that the JDBC driver depends on. The download page there bundles everything up into a single zip file if you intend to drop it in an application that just knows about JDBC. If you're developing something that uses JDBC, you can use Maven and the dependency management to pull in the jars you need.

I am still struggling to find a complete example on how to use java for CRUD operations in elasticsearch can you please point me to some where?

Elasticsearch's SQL is currently read-only. If you're building an app on top of Elasticsearch in Java, I'd recommend using the Java high-level REST client.
You can find examples for creating/updating/deleting documents in the documentation there: https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-supported-apis.html

last but not least .. any working examples available?

Working examples of SQL or working examples of the REST client?

working examples of elastic rest client where it shows how to query elasticsearch from a java app.

You can find examples of search and the related features at https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-search.html

You'll need to initialize the client first: https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-getting-started-initialization.html

So something like the following for a simple search:

RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(
                    new HttpHost("localhost", 9200, "http")));
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.query(QueryBuilders.matchAllQuery());            
searchSourceBuilder.aggregation(AggregationBuilders.terms("top_10_states").field("state").size(10));
SearchRequest searchRequest = new SearchRequest();
searchRequest.indices("social-*");
searchRequest.source(searchSourceBuilder);
SearchResponse searchResponse = client.search(searchRequest);

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.