I am handling how to find the primary key of data in ES index. I know that ES has _id to represent each document's unique id, but the problem is that when I handling the data which has been stored in ES, the data may be exported from RDB like MySQL. How can I get the primary key in this situation?
Elasticsearch does not have a concept of primary key. The only thing that uniquely identifies a document is the index together with the id. I would recommend setting the document id to the primary key when indexing from a relational database.
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.