Export parent child oracle table in elastic search

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?

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:

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