Hello everyone,
I am trying to use Java api within Eclipse in order to aggregate my data in Elasticsearch.
I successfully created a client to access my elasticsearch. Now, I want to do aggregations, that's why i followed this tutorial https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-aggs.html
SearchResponse sr = node.client().prepareSearch()
.setQuery( /* your query / )
.addAggregation( / add an aggregation */ )
.execute().actionGet();
However, it does not indicate how to initialize the variable 'node'. I put:
Node node = NodeBuilder.nodeBuilder().node();
SearchResponse sr = node.client().prepareSearch()
.setQuery( /* your query / )
.addAggregation( / add an aggregation */ )
.execute().actionGet();
But, I get the error: The method prepareSearch(String[]) in the type Client is not applicable for the
arguments ()
So, do you know how I have to initialize node ?
Thank you for your attention and your help.
S