How to push json data from spark to elastic search

Hi m new elasticsearch and m trying to push json data to elastic search, But when i execute following code:
JavaDStream<Map<String, Object>> facts>{
	    HashMap<String, Object> factMap = new HashMap<>();
	    Gson gson = new Gson();
	    factMap = (HashMap<String, Object>) gson.fromJson(json, factMap.getClass());
	    factMap.put("timestamp", EpochTime.getTimeStamp());
	    return factMap;
	//pushing to ES
		JavaEsSpark.saveToEs(rdd, "sample/newdata");

I am only getting key part in elasticsearch and not value can. why ? what updates are required in code

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