AWS GLUE to Open Search Index custom Index Id

0

I have a glue job which pushes the data from glue into open search. The index Id column is automatically created while inserting the data into open search. I would like to pass the index id _id field into open search while pushing the data using glue. what parameter should I be using or how can I pass a custom specific index_id to an open search index?

srm
已提問 1 個月前檢視次數 318 次
1 個回答
0
已接受的答案

Basically there two ways, I did this using dynamic mapping with dynamic documents

Define a Hidden Column

In your Glue Catalog table, add a hidden column named _id. This column will store the custom index ID you want to use for each record.

Access the Value in Glue Script

Within your Glue job script (Python or Scala), access the value of the hidden _id column for each record being processed.

Enable Dynamic Documents

When configuring the OpenSearch data sink in your Glue job, set the "Dynamic Documents" option to "true" within the connection properties. This allows Glue to dynamically add the _id field with your custom value during data insertion.

The other way is pre defined index mapping, let me know if you want to know about it.

Here are the references that might help you

  1. https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-crawler-pyspark-extensions-dynamic-frame-writer.html
  2. https://docs.aws.amazon.com/glue/latest/dg/connecting-to-data-opensearch.html
  3. https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html
profile picture
已回答 1 個月前
  • I would like to know about pre defined index mapping.Do you have an example?

  • When configuring the OpenSearch data sink in your Glue job, set the "Dynamic Documents" option to "true" within the connection properties. This allows Glue to dynamically add the _id field with your custom value during data insertion. Can you share an example for this

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南