Elastic Search - Multiple Field as mapping ID in Spark

后端 未结 3 1725
[愿得一人]
[愿得一人] 2021-01-22 20:05

I am pretty new to elastic search. I am using elasticsearch-hadoop 6.2.4 version and I am reading the files from HDFS, converting to bean object and wr

3条回答
  •  温柔的废话
    2021-01-22 20:28

    According to Elastic Documentation; mapping id option is take 1 column name, so; you can not set multiple columns as id. but you can solve this issue by creating a new column with this value like this:

    dataSet.withColumn('id', CustomerID + OrderID)
    

提交回复
热议问题