Join relationship using Elasticsearch client interface

I am looking for any examples that implement parent-child relationship using the python interface.
I can define a mapping such as

      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. 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.

Following the example in, I tried adding
jsonDict['my_join_field']= 'document'

and a pageDict where,


res = es.index(index="docpage",doc_type="_doc",body=pageDict) , but I get a parser error.....

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