Relationship with one to one type

Each child node can have only one direct parent.

We can specify the relationship between a parent and child node with the relationship property.

[
    {
        "database": "book",
        "index": "book",
        "nodes": [
            {
                "table": "book",
                "children": [
                    {
                        "table": "author",
                        "columns": [
                            "id",
                            "name"
                        ],
                        "relationship": {
                            "variant": "object",
                            "type": "one_to_one"
                        },
                    }
                ]
            }
        ]
    }
]

To get this document structure in Elasticsearch

[
  {
      "isbn": "9785811243570",
      "title": "Charlie and the chocolate factory",
      "publisher": {
          "id": 1,
          "name": "Oxford Press"
      }
  },
  {
      "isbn": "9788374950978",
      "title": "Kafka on the Shore",
      "publisher": {
          "id": 2,
          "name": "Penguin Books"
      }
  },
  {
      "isbn": "9781471331435",
      "title": "1984",
      "publisher": {
          "id": 3,
          "name": "Pearson Press"
      }
  }
]

Info

A relationship must define both a variant and a type attribute