// Index name
String _index = response.index();
// Type name
String _type = response.type();
// Document ID (generated or not)
String _id = response.id();
// Version (if it's the first time you index this document, you will get: 1)
long _version = response.version();
IndexResponse response = client.prepareIndex("twitter", "tweet")
.setSource(json)
.execute()
.actionGet();
IndexResponse object will give you report:
// Index name
String _index = response.index();
// Type name
String _type = response.type();
// Document ID (generated or not)
String _id = response.id();
// Version (if it's the first time you index this document, you will get: 1)
long _version = response.version();
index() -> getIndex()
type() -> getType()
id() -> getId()
version() -> getVersion()
Please make the correction.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.