I am looking for any examples that implement parent-child relationship using the python interface.
I can define a mapping such as
es.indices.create(
index= "docpage",
body= {
"mappings": {
"properties": {
"my_join_field": {
"type": "join",
"relations": {
"document": "page"
}
}
}
}
}
)
I am then indexing a document using
res = es.index(index="docpage",doc_type="_doc",id = 1, body=jsonDict) , where jsonDict is a dict structure of document's text and other relevant info.
How do I then index a page in the document ?
When I try
res = es.index(index="docpage",doc_type="_doc",parent=1, body=page)
I get an error : RequestError(400, 'illegal_argument_exception', 'request [/docpage/_doc] contains unrecognized parameter: [parent]')
Ref. https://elasticsearch-py.readthedocs.io/en/master/api.html indicates that parent is a valid parameter.
I see that I am not providing ES with any info about document or a page when I index them.