# Export parent child oracle table in elastic search

**URL:** <https://discuss.elastic.co/t/export-parent-child-oracle-table-in-elastic-search/358651>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [May 2, 2024, 1:50pm UTC](https://discuss.elastic.co/t/export-parent-child-oracle-table-in-elastic-search/358651 "2024-05-02T13:50:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikeyanc2003](https://avatars.discourse-cdn.com/v4/letter/k/ea5d25/32.png) [@karthikeyanc2003](https://discuss.elastic.co/u/karthikeyanc2003)\
**Post date:** [May 2, 2024, 1:50pm UTC](https://discuss.elastic.co/t/export-parent-child-oracle-table-in-elastic-search/358651/1 "2024-05-02T13:50:56Z")

</div>

Dear Team,

I am an RDBMS guy and new to Elastic search. I require your expertise and help on the below requirements,

I have the below tables in Oracle. Director & movies

**Director**

| Name | Year of birth | Name id | Birth place |
| --- | --- | --- | --- |
| James Francis Cameron | 1954 | 1 | Kapuskasing |
| Steven Allan Spielberg | 1946 | 2 | ohio |

**movies**

| movie\_name | Imdb\_Rating | Release\_year | Director\_id |
| --- | --- | --- | --- |
| Jaws | 8 | 1975 | 2 |
| Jurassic park | 7 | 1993 | 2 |
| avatar | 6 | 2009 | 1 |
| titanic | 9 | 1997 | 1 |

I want to create a parent-child structure index in ES and move the data from Oracle to Elastic Search. Could you please help me with the index structure and move data from Oracle to es?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 2, 2024, 5:35pm UTC](https://discuss.elastic.co/t/export-parent-child-oracle-table-in-elastic-search/358651/2 "2024-05-02T17:35:13Z")

</div>

Welcome!

I'd totally forget about the existing model and would just think about the usage to build the right "search" objects for my use case.  
Here I can't really answer as I don't know the use case.

Basically I'd recommend to ask yourself 2 questions:

- What kind of objects my users want to get back as a response? If it's object `X`, then just index object `X`
- What typical attributes my users want to search for? Let say I need attribute `a`, `b` and `c`, just index those attributes within object `X` whatever the original source of those attributes is.

This is named "denormalization" of your data.

So I'd index movies this way:

```auto
PUT /movies/_doc/1
{
  "name": "jaws",
  "rating": 8,
  "release": 1975,
  "director": {
    "name": "Steven Allan Spielberg",
    "birth": {
       "year": 1946,
       "place": "ohio" 
    }
  }
}
PUT /movies/_doc/2
{
  "name": "Jurassic park",
  "rating": 7,
  "release": 1993,
  "director": {
    "name": "Steven Allan Spielberg",
    "birth": {
       "year": 1946,
       "place": "ohio" 
    }
  }
}

```

HTH
