Could someone help me ? --How to implement join datatype by Java API

As the mapping type will be removed, so we plan to use the join datatype for parent/child doc, but I don't know which Java api should be used, could someone help provide below function by Java code ? thank you in advance.

PUT my_index { "mappings": { "_doc": { "properties": { "my_join_field": { "type": "join", "relations": { "question": "answer"  } } } } } }

PUT my_index/_doc/1?refresh { "text": "This is a question", "my_join_field": { "name": "question"  } }

PUT my_index/_doc/3?routing=1&refresh { "text": "This is an answer", "my_join_field": { "name": "answer", "parent": "1"  } }

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