I am using java high level rest client for integrating elasticsearch in my application,But not able to create an index
somewhere I found that to execute the request we need to use index(request) method (which I have commented in my code) but it is shwing that index(request) method is deprecated from the type RestHighLevelClient.
Here is my code:
@GetMapping("/createIndex")
public boolean createIndex() throws IOException {
IndexRequest request = new IndexRequest(
"muviuser",
"user",
"1");
String jsonString = "{" +
"\"user\":\"Bran\"," +
"\"postDate\":\"2018-01-30\"," +
"\"message\":\"trying out Elasticsearch\"" +
"}";
request.source(jsonString, XContentType.JSON);
//client.index(request);
}